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

Open the dialog automatically #109

Open
acespace90 opened this issue Jun 15, 2018 · 2 comments
Open

Open the dialog automatically #109

acespace90 opened this issue Jun 15, 2018 · 2 comments
Labels

Comments

@acespace90
Copy link

acespace90 commented Jun 15, 2018

Hi, is it possibile to open the dialog for example at document.ready?
So without clicking on a button.

Am I wrong or that method is missing?

@adamduncan
Copy link
Contributor

Hi @acespace90. Unfortunately the _showModal method is private. This is one of those wish we made a few more methods public in v1 things.

It's possible to show a modal by default, but requires a fair bit of mucking around with attributes/events. Here's a quick demo I've put together: https://codepen.io/adamduncan/pen/YvrYZp

It lacks a few a11y concerns (focus trap, ESC key binding, returning focus somewhere on close) and niceties (unbinding close events).

Given it's not properly accessible (in the same way one opened by a user clicking on a button), I'd maybe suggest using an alternative plugin, which exposes the events you need. E.g. a11y-dialog is great 👌

@acespace90
Copy link
Author

Ok thank you @adamduncan, hope to see that method public in the a soon future ;-)

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

No branches or pull requests

2 participants