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

Vex modals not working as expected #121

Closed
vchatterji opened this issue Jun 23, 2016 · 3 comments
Closed

Vex modals not working as expected #121

vchatterji opened this issue Jun 23, 2016 · 3 comments

Comments

@vchatterji
Copy link

vchatterji commented Jun 23, 2016

IMPORTANT: Please provide a sample using http://plnkr.co/edit/iiQett?p=preview

  • I'm submitting a ...
    [*] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
  • Do you want to request a feature or report a bug?
  • What is the current behavior?

http://plnkr.co/edit/6radRdh9NvZOQJh7SWb2?p=preview

In the Vex theme (even on your demo page), when a modal container opens, a blue outline of the final dialogue position shows up first and then the dialogue is animated into the container.

Please see:
http://shlomiassaf.github.io/angular2-modal#/vex-demo

  • What is the expected behavior?

Dialogue should be placed and animate correctly

  • What is the motivation / use case for changing the behavior?

Functionality is not working properly

  • Please tell us about your environment:
  • Angular version: 2.0.0-rc.2
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

All

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
@shlomiassaf
Copy link
Owner

shlomiassaf commented Jun 23, 2016

I think the blue border is actually the focus element, I think it sets the focus and run's the animation on the same VM turn.

This doesn't happen in FireFox on my mac but it does on Chrome.

I don't know if it's an issue with Chrome or the animation module in angular 2.
A workaround is to set the focus once the animation ends, but that's not something I want to do...

It disappear once you click anywhere, even lets say on the developer console. It implies that some sort of refresh is missing on chrome or Angular animation.

I'll try to investigate.

EDIT: Not related to animation module in angular, this is pure CSS animations.

@vchatterji
Copy link
Author

vchatterji commented Jun 24, 2016

It happens on Safari as well.

@shlomiassaf
Copy link
Owner

pushed a workaround.

The focus management is basic at this point, a practical implementation will be to identify elements on the dialog and set the focus on the right one.

For example, if it's a prompt focus the input, otherwise focus the last button (e.g: OK) otherwise focus the dialog window.

This requires a central unit to manage focus having children publishing to it since a child component has reference to it's elements... then it needs to prioritise it and decide... not so simple :)

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

2 participants