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

[Sidebar] Respect a change of closable setting #335

Merged

Conversation

lubber-de
Copy link
Member

@lubber-de lubber-de commented Dec 31, 2018

Description

The closable setting is ignored in sidebar when the setting was changed after initialization.

Testcase

  • Keep the red sidebar open
  • Click on "Fix sidebar"
  • Click on "Toggle sidebar"
    -> Sidebar should not close

Unfixed (original SUI issue)

https://jsfiddle.net/r7fws0nn

Fixed

https://jsfiddle.net/r7fws0nn/23/

Closes

Semantic-Org/Semantic-UI#5329

@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews tag/sui-issue Taken from an existing Issue/PR of SUI labels Dec 31, 2018
@lubber-de lubber-de added this to the 2.7.x milestone Dec 31, 2018
y0hami
y0hami previously approved these changes Dec 31, 2018
Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ColinFrick
Copy link
Member

The other way around doesn't work either. If you set closable to false, open it, then set closable to true from inside the sidebar doesn't bind the clickaway events:

clickaway: function() {
module.verbose('Adding clickaway events to context', $context);
if(settings.closable) {
$context
.on('click' + elementNamespace, module.event.clickaway)
.on('touchend' + elementNamespace, module.event.clickaway)
;
}
},

https://jsfiddle.net/Korinu/5obdax1z/

@lubber-de
Copy link
Member Author

@ColinFrick Then i suggest to always bind the clickaway events, regardless of the closable setting, just because the closable setting is centrally fetched in the hide function. Agree?

@lubber-de
Copy link
Member Author

lubber-de commented Dec 31, 2018

@ColinFrick As suggested, the clickaway is now bound in any case. This was the easiest (in my pov cleanest) solution. otherwise i had to bind/unbind the clickway every time the closable settings changes and i feared other bugs then.

Copy link
Member

@ColinFrick ColinFrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s fine

LGTM

Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami merged commit 4de7c51 into fomantic:develop Jan 4, 2019
@y0hami y0hami removed the state/awaiting-reviews Pull requests which are waiting for reviews label Jan 4, 2019
@lubber-de lubber-de modified the milestones: 2.7.x, 2.7.2 Jan 4, 2019
@y0hami y0hami mentioned this pull request Feb 4, 2019
@lubber-de lubber-de deleted the fix/5329/sidebar_respect_closable_change branch February 5, 2019 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript tag/sui-issue Taken from an existing Issue/PR of SUI type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants