Code Monkey home page Code Monkey logo

ember-modal-dialog's People

Contributors

amk221 avatar azhiv avatar connorhome avatar philliphaines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-modal-dialog's Issues

How do I get the package from GitHub packages?

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.

Don't focus the first element after the window gets focus

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?

get focusableElements gets the disabled items as well

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"])
];
}

Conditionally close the dialog when escapable

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.