zestia / ember-modal-dialog Goto Github PK
View Code? Open in Web Editor NEWπ² Animatable modal dialogs for Ember apps
License: MIT License
π² Animatable modal dialogs for Ember apps
License: MIT License
In your demo, if you select text spreading the cursor out of the dialog and release the mouse button, the dialog closes. This is not desired in most cases, is it?
Is there a way to prevent such behaviour?
I see WARNβ deprecated @zestia/[email protected]
and the npm page says Moved to GitHub Packages
.
How do I install the package? The instructions in readme seem out of date.
I also don't see any packages when I go to https://github.com/orgs/zestia/packages?repo_name=ember-modal-dialog
.
So you have a special piece of code that focuses the first focusable element when the window gets focus. This behaviour is not consistent with the case of the initial dialog opening:
In one of the dialogs of our app the first focusable element is ember-power-element trigger. So on the initial dialog open the form is neat, but if I change the browser tab and then change it back, the power calendar gets opened which is not desired. This happens because the focus on the trigger does this.
The best workaround I managed to find is overriding _handleFocusedWindow() {}
, which is kinda ugly. Do you consider this feature to be absolutely necessary?
I have a dialog that has the last element disabled. This only gets enabled when I put something in the textbox within the dialog. Problem is that the focus trapping fails when this button is disabled. This was because it was included in the focusable elements even if it is disabled.
Also found out that :not(disabled) does not work, but :not([disabled]) does.
So Focus trap was ok when I changed the focusable elements into this
get focusableElements() {
return [
...this.element.querySelectorAll(a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex="0"], [contenteditable="true"]
)
];
}
The latest version published in npm contains dependency @ember/render-modifiers which is not really used.
While you have a dialog open, if you click on the URL bar and try to tab from it, it will not go to the first focusable element in your dialog.
Using as your demo as a sample (https://zestia.github.io/ember-modal-dialog/) from the URL textbox, when I click on tab, it will go to the "Fork me on Github" even when the dialog is open.
It would be very convenient if the dialog would close conditionally when the user attempts to close it. Consider the following scenario: if the user clicks outside of the dialog and it should close, we show another dialog asking "Are you sure?". If yes, close both dialogs. If not, close the "Are you sure?" dialog and keep the original one open.
I was able to achieve the desired result by overriding _hide
method:
_hide() {
if (!this.args.onClosing || this.args.onClosing() === true) {
return super._hide();
}
return reject();
}
But since your last changes this no longer works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.