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

Text input in a modal dialog loses focus #2445

Closed
1 task done
eringram opened this issue Feb 20, 2025 · 0 comments · Fixed by #2443
Closed
1 task done

Text input in a modal dialog loses focus #2445

eringram opened this issue Feb 20, 2025 · 0 comments · Fixed by #2443
Labels
bug Something isn't working

Comments

@eringram
Copy link
Member

Describe the bug (current behavior)

In a modal component with a text input, each time a character is entered, the input box loses focus such that the cursor is no longer blinking in the input and you have to click on it again to type another character. This only occurs with inputs in the Modal component, and I was able to work around it by switching to a Dialog component. It also doesn't occur when the input is directly on a page (not in a modal).

I noticed it happening with @itwin/itwinui-react version 3.17.0, but It doesn't happen with 3.17.0-dev.1. It also happens with 3.16.0, but I haven't tested any other older versions.

Expected Behavior

The text input in a modal will stay in focus when you type.

Link to minimal repro

https://stackblitz.com/edit/github-p4dxfcdf?file=src%2FApp.tsx

Steps To Reproduce

  1. In a text input in a modal component, try to type out a word
  2. Observe that when you type one letter, the input loses focus and you must click it again to continue typing

Package Version

  • I'm using the latest version of iTwinUI.

Anything else?

No response

@eringram eringram added the bug Something isn't working label Feb 20, 2025
@mayank99 mayank99 linked a pull request Feb 20, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant