Closed Jarrio closed 5 years ago
To implement a drawer, you should use a standard <dialog>
element. Check the "Left side drawer" and "Right side drawer" examples on https://xel-toolkit.org/elements/dialog
Ah, I appreciate that. I would like to mention that pretty much all of these dialog's seem to be impossible to close when triggering them as there is no close button visible to actually press - ESC, enter or clicking the background does not trigger the dialog to close either. Basically forcing a refresh of the page.
I am using Chrome Version 71.0.3578.98 (Official Build) (64-bit)
(For the demo - I haven't actually tried it from within electron as of yet)
Are you still unable to close the dialogs by clicking the backdrop with Xel version 0.0.179 (I published it several minutes ago). Please clear the browser cache and reload to make the demo use the latest Xel version.
Yes, this fixed the issue. Thanks!
To close a dialog with Esc key:
dialog.addEventListener("keydown", (event) => {
if (event.code === "Escape") {
dialog.close();
}
});
How do you have the dialog open by default? Setting the button to toggled
doesn't seem to work as expected. The button is toggled but the drawer remains closed
You should call button.expand()
or dialog.showModal()
method.
The README says that this has drawer support but there doesn't appear to be any API for it on docs even though the demo has a side menu, an example of the code for the side menu would be appreciated - thanks!