Skip to content

fix(modal,flyout): autofocus fix for input and non focusable elements#2708

Merged
lubber-de merged 8 commits intofomantic:developfrom
lubber-de:autoFocusFix
Feb 26, 2023
Merged

fix(modal,flyout): autofocus fix for input and non focusable elements#2708
lubber-de merged 8 commits intofomantic:developfrom
lubber-de:autoFocusFix

Conversation

@lubber-de
Copy link
Copy Markdown
Member

@lubber-de lubber-de commented Feb 20, 2023

Description

  • Autofocus was not taking care of invisible inputs (in dropdown)
  • classname observer was too sensible and accidently triggered autofocus (search, dropdown, form validation)
  • autofocus should only focus inputs, otherwise focusing the module directly for focustrap
  • click into an input when window was refocused triggered autofocus instead of respecting the clicked input

Testcase

Broken

https://jsfiddle.net/qro3we4y/1/

Fixed

https://jsfiddle.net/lubber/yczjfh27/2/

Closes

#2698
#2700
#2703
#2674 (comment)

@lubber-de lubber-de changed the title fix(modal,flyout): autofocus fix for dropdown, search and non existing inputs fix(modal,flyout): autofocus fix for input and non focusable elements Feb 26, 2023
@lubber-de lubber-de merged commit 9f9137a into fomantic:develop Feb 26, 2023
@lubber-de lubber-de deleted the autoFocusFix branch February 26, 2023 21:02
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant