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

can close modal with escape key even if closable is set to false #262

Closed
luisrudge opened this issue Oct 18, 2013 · 4 comments
Closed

can close modal with escape key even if closable is set to false #262

luisrudge opened this issue Oct 18, 2013 · 4 comments

Comments

@luisrudge
Copy link
Contributor

today, we can still close a modal even if the closable option is set to false.

@jlukic jlukic closed this as completed in d9d583f Oct 18, 2013
jlukic added a commit that referenced this issue Oct 18, 2013
@larsbo
Copy link
Contributor

larsbo commented Jan 11, 2016

I think this should be achieved by two options. There are use cases where the previous behavior (modal not closable by clicking but by pressing escape) is desired e.g. a slideshow with clickable arrows inside a modal.

The description for the closableoption mentions only the click behavior, by the way 😉

Setting to false will not allow you to close the modal by clicking on the dimmer

larsbo added a commit to larsbo/Semantic-UI that referenced this issue Jan 29, 2016
to specify the exact closable behavior of a modal you can now set
closable to ```click``` to allow closing nnly by clicking on the dimmer
or you can set it to ```escapeKey``` to allow closing only by pressing
the escape key.
@evenfrost
Copy link

evenfrost commented Nov 2, 2016

I need exactly this behaviour in my project , i.e. prevent closing a modal when clicking on the dimmer, but allow this when pressing Esc button. Tried to pass closable: false, keyboardShortcuts: true options, but this didn't work.

@smartm0use
Copy link

What does keyboardShortcuts stand for?
I need the same behaviour, prevent closing when clicking on the dimmer, but allow closing when pressing Esc button. How can I reach that?

@awgv
Copy link
Member

awgv commented Jun 12, 2017

@smartm0use If you need this functionality, you can fork the modal component and implement the changes by @larsbo that you can find here #3625. Read the first post to understand how to use it. Also, since you’re forking the modal, don’t forget to exclude it from being built in semantic.json.

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

No branches or pull requests

5 participants