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

improve: Restore TextField focus state after configuration change #17

Open
satwanjyu opened this issue Jul 12, 2023 · 1 comment
Open

Comments

@satwanjyu
Copy link
Owner

Current implementation loses TextField focus after configuration change. The cursor location (selection) is preserved via rememberSaveable, but that wouldn't be helpful if the focus is lost and the customer will have to click into the TextField which would then point the cursor to a new location.

Putting this in the backlog since I haven't found a trivial way to restore focus state (esp. for a large form).

@satwanjyu
Copy link
Owner Author

I've just realized rememberSaveable<TextFieldValue> wouldn't work since configuration change includes composition change e.g. rotating to landscape changes the composition to NavRailScaffold. I'd need to preserve TextFieldState in ViewModel.

Related to #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant