[fix] Selectbox with accept_new_options on mobile shows keyboard#12219
Merged
sfc-gh-bnisco merged 4 commits intodevelopfrom Aug 15, 2025
Merged
[fix] Selectbox with accept_new_options on mobile shows keyboard#12219sfc-gh-bnisco merged 4 commits intodevelopfrom
sfc-gh-bnisco merged 4 commits intodevelopfrom
Conversation
Contributor
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Contributor
✅ PR preview is ready!
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where selectbox with accept_new_options enabled on mobile devices would prevent the keyboard from appearing, making it impossible for users to type new options. The fix ensures that when acceptNewOptions is true, the input field is not set to readonly on mobile devices, allowing users to enter custom values.
- Modified the readonly condition to consider the
acceptNewOptionsprop - Added comprehensive test coverage for mobile behavior with both enabled and disabled
acceptNewOptions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/lib/src/components/shared/Dropdown/Selectbox.tsx | Updated readonly condition to allow keyboard input when acceptNewOptions is true |
| frontend/lib/src/components/shared/Dropdown/Selectbox.test.tsx | Added mobile-specific tests to verify keyboard behavior with acceptNewOptions |
mayagbarnes
reviewed
Aug 14, 2025
f33b526 to
8e8d434
Compare
4 tasks
sfc-gh-bnisco
added a commit
that referenced
this pull request
Aug 28, 2025
…vior (#12330) ## Describe your changes - We previously fixed a bug in `st.selectbox` (#12219), but not in `st.multiselect`. Ultimately, this is because the code is effectively duplicated between the 2, despite much of the behavior needing to be the same. - This PR moves the shared logic into a shared place, thus reducing duplication and fixing the bug in both places as expected. ## GitHub Issue Link (if applicable) ## Testing Plan - ✅ Updated unit tests --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
accept_new_optionsargument that was added a few months ago tost.selectbox.Here it is working on the preview app from this branch in iOS:

GitHub Issue Link (if applicable)
Fixes #12205
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.