Skip to content

Conversation

bttlvd-ya
Copy link
Contributor

input's autoFocus is not working when an input is placed inside Modal or Dialog components. Possible problem is that a modal's animation starts from 'display: none' while the inner content has already been rendered.

I wrote a sandbox with a small research of possible solutions : https://codesandbox.io/p/sandbox/quizzical-chatelet-gzy3vr

Somehow i found a Modal's initialFocus prop and decided to use it here (the last solution in the sandbox). Unfortunately, use cases of this prop are not described in docs, but looks like that the prop was created exactly to fix issues like the one described in the ticket.

InitialFocus can receive a Ref of an element (or an index number of interactive element inside a modal body) which need to be focused when a modal opens.

Copy link

📦 Statoscope quick diff with main-branch:

⏱ Build time: 4.8 sec (5.53%)

⚖️ Initial size: 0.02 kb (0%)

🕵️ Validation errors: 0

Full Statoscope report could be found here ↗️

Copy link

E2E Tests

Playwright test results

passed  180 passed
flaky  2 flaky
skipped  2 skipped

Details

stats  184 tests across 101 suites
duration  7 minutes, 50 seconds
commit  3508a3f

Flaky tests

opensource › opensource-suites/dash/selectors/autoupdateRelatedSelectors.test.ts › Dashboards - Autoupdate options of group selectors › Dataset selectors affect each other before applying when auto-update is enabled
opensource › opensource-suites/wizard/filters/filters-with-dialog-color.test.ts › Wizard filters › Two or more values of the Date field from the dashboard filter section should use IN operation by default

Skipped tests

opensource › opensource-suites/dash/revisions/revisionsList.test.ts › Dashboards - Versioning › Dashboard with a long list of revisions, checking the upload and the updated list of revisions
opensource › opensource-suites/dash/selectors/autoupdateRelatedSelectors.test.ts › Dashboards - Autoupdate options of group selectors › Manual selectors with aliases don't affect each other before applying when auto-update is disabled


👉 Link with detailed report: report

@bttlvd-ya bttlvd-ya merged commit 293dc68 into main Aug 21, 2025
8 checks passed
@bttlvd-ya bttlvd-ya deleted the CHARTS-11184-rename-entry-input-autofocus branch August 21, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants