feat: add option to disable modal inputs on mobile #6625
Merged
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.
The basics
npm run format
andnpm run lint
The details
Resolves
Fixes #6608
Proposed Changes
Adds an option called
modalInputs
to BlocklyOptions (and Options). Default is true. If false, then FieldTextInput and its subclasses will not show the modal prompt editor when on mobile browsers.Behavior Before Change
Always show the modal editor if on mobile browser.
Behavior After Change
Default is to show modal editor if on mobile, but this can be disabled by setting the new option to false. If it's false, we'll show the inline editor like we would on desktop.
Reason for Changes
Not everyone wants the modal UI, especially these days when the mobile keyboard experience is not as bad as it used to be (e.g. smart bumping of content now)
Alternatives Considered
Test Coverage
Tested manually in the playground. I looked at adding this to the advanced playground UI in core but as far as I can tell you can't modify the existing folders and I didn't want to make another new one. After this is released, it could be added as an option in the advanced playground in samples.
Documentation
Needs to be documented in the devsite article about the configuration struct.
Additional Information
Please fight over the name of the option in the comments.