Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive panel inconsistency #1294

Open
jlchereau opened this issue Dec 1, 2015 · 2 comments
Open

Responsive panel inconsistency #1294

jlchereau opened this issue Dec 1, 2015 · 2 comments

Comments

@jlchereau
Copy link
Contributor

k-rpanel-toggle class should be able to designate a button to toggle the responsive panel and this button should behave consistently whether it is located in a kendo.ui.ToolBar or not.

Spend more than 5 min trying to understand the problem by running:

See #1289

@gyoshev
Copy link
Contributor

gyoshev commented Dec 2, 2015

Hello @jlchereau. As noted in the referenced issue, the behavior of the k-rpanel-toggle is overwritten by the toolbar responsive behavior. Even if the toggle button has higher specificity, this will break the ToolBar algorithm, which determines when to display buttons. We are open to suggestions on how to fix this problem, without letting either widget know of the other one.

@jlchereau
Copy link
Contributor Author

@gyoshev Thank you for discussing this issue.

IMHO the purpose of a framework is not only to offer widgets but also and especially to offer a consistent set of widgets that integrates well. The responsive panel does not integrate well with the toolbar.

I agree that JS code dependency between widgets should be avoided but this can certainly be sorted out using CSS.

The workaround I have used involves Twitter Bootstrap hidden-* classes which works because I use a responsive panel breakpoint that corresponds to Bootstrap media queries (xs, sm, md, lg):

toolbar.kendoToolBar({
    items: [
       ...
        { type: 'buttonGroup', buttons: [{ id: INFO, text: culture.instructions.text, imageUrl: kendo.format(app.uris.cdn.icons, culture.instructions.icon), attributes: { 'class': 'k-rpanel-toggle hidden-md hidden-lg' }, togglable: true }] }
       ...
    ]
});
<div data-role="responsivepanel" class="k-widget k-content" data-orientation="right" data-breakpoint="992">

SOLUTION: So as to accomodate any breakpoint value, I suggest the responsive panel should simply add the css media query rule that hides the configured toggleButton when page width is above the breakpoint.

This should not be a problem since as documented the breakpoint refers to the page width, not the container width so media query rules apply.

It is simple and avoids any dependency between components. Note that the workaround works well for the instructions panel here below and there is no interference with the toolbar responsive behaviour:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants