fix(modal,flyout): avoid multiple autofocus on show animation#2674
fix(modal,flyout): avoid multiple autofocus on show animation#2674lubber-de merged 5 commits intofomantic:developfrom
Conversation
|
Somebody, please authorize this pull request. |
|
@lubber-de this has introduced another bug, steps to reproduce:
The problem has been introduced between |
|
@mvorisek Here is a jsfiddle where i copied your modal HTML , but unfortunately the issue does not happen there and works as expected. If i enter anything inside the ISO fields and press tab it focuses the next field. I believe some form validation is missing ? https://jsfiddle.net/lubber/yn7qjuer/4/ I am already working on fixing search/dropdown components, but in your case its a common text input.. |
|
@lubber-de the described issue is the exact duplicate of #2700 |
Description
jquery's focus trigger does not seem to work / detect a non-input element as visible all the time. Although the autofocus is called after the animation has ended a same modal opened a second time (but without input content) does not focus the modal div again, thus focus trap did not work.
This is caused by the new mutationobserver logic fetching class attributes, so the focussing takes place several times, while not necessary when the moda/flyout is animated.
This PR now only observes attributes when the modal/flyout has completed showing as the showing process itself changes class attributes.
Closes
#2575 (comment)