feat(NcModal): expose `initialFocus` prop for focus-trap options
☑️ Resolves
- Exposing
initialFocusandsetReturnFocusto NcModal and NcDialog consumers- See https://github.com/focus-trap/focus-trap#initialfocus
- Allows to manipulate initial focus (e.g. in case first element in the trap is NcSelect and we don't want it to be open)
🖼️ Screenshots
🚧 Tasks
🏁 Checklist
- [ ] ⛑️ Tests are included or are not applicable
- [ ] 📘 Component documentation has been extended, updated or is not applicable
- [ ] 2️⃣ Backport to
stable8for maintained Vue 2 version or not applicable
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 52.20%. Comparing base (49763e7) to head (8afa991).
Additional details and impacted files
@@ Coverage Diff @@
## main #7587 +/- ##
=======================================
Coverage 52.20% 52.20%
=======================================
Files 101 101
Lines 3174 3174
Branches 871 872 +1
=======================================
Hits 1657 1657
Misses 1271 1271
Partials 246 246
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
I forgot about that PR🪦 Shall we get it in?
Was it for the translation dialog in chat?
Yes, in general it fits for any dialog that does not need to have an initial focus on the child element
- (e.g. in case first element in the trap is NcSelect and we don't want it to be open)
With a small CSS fix, and by using available props and events we can make NcSelect open only manually but not by focus.
Would it also work for you?
we can make
NcSelectopen only manually but not by focus. Would it also work for you?
Depends on how it changes current default behaviour, and what app developers should do to implement it. I'd take a look =)