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

[Enhancement] - Option to choose the element to focus on opening modal #875

Open
thamotharan-karuppaiah opened this issue Jul 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@thamotharan-karuppaiah
Copy link

Component
fw-modal

Describe the bug
I'm using fw-modal. In the modal popup, the secondary button "Cancel" is automatically focused whenever the modal is opened. However, our designer doesn't want this specific behaviour of the secondary button being highlighted automatically. I have checked the documentation but couldn't find anything on how to disable this behaviour.

To Reproduce
Steps to reproduce the current behaviour:

  1. Create an fm-modal and open it.
  2. Secondary button (i.e. Cancel) is getting highlighted(i.e focused) automatically.

Expected behaviour
Do not want to focus the secondary button by default

Screenshots
image

Additional context
Add any other context about the bug here.

@thamotharan-karuppaiah thamotharan-karuppaiah added the bug Something isn't working label Jul 3, 2023
@Vignesh-Manogar-E3433
Copy link
Contributor

Hi @thamotharan-karuppaiah , this is not a bug. It is the expected behaviour to highlight the first focusable element in the modal on opening the modal.

Currently, there is no way to change the behaviour. We can take this up as a feature request.

To fix this temporarily, we can maybe change the order of the buttons in the footer by adding custom footer buttons like in example here.
https://codesandbox.io/s/zen-stonebraker-mfzyqz?file=/index.html

@Vignesh-Manogar-E3433 Vignesh-Manogar-E3433 added enhancement New feature or request and removed bug Something isn't working labels Jul 13, 2023
@Vignesh-Manogar-E3433 Vignesh-Manogar-E3433 changed the title [Bug] - Disabling Automatic Focus on Secondary Button in fw-modal - Seeking Assistance [Enhancement] - Option to choose the element to focus on opening modal Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants