fix: do not hide chaff when resizing #6916
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 #6915
See that issue for a lot of additional context.
Proposed Changes
false
which means the widget div will hide itself, the same as today. But if you override this method and return true, that means the field will handle its own reposition logic.field_input
to resize themselves. This means subclasses of this field (text, multiline text, number, and angle, along with any custom developer fields) will resize the widget div automatically (by calling the existingresizeEditor_
method).bump_objects
method to make it more generic. Previously this method was only used to bump things into the scrollable region of the workspace. We need the exact same logic to bump it into the visible region of the workspace, and you can achieve this just by passing a different set of bounds into the function.Behavior Before Change
On resizing a window while you have a widget or dropdown div open, they would be hidden. This causes the soft keyboard on Android to make fields unusable.
Behavior After Change
The dropdown and widget divs attempt to keep themselves open. This allows you to resize the window while editing an input field, or use fields on Android with the soft keyboard.
Reason for Changes
bug fixes and because some projects don't want to use the modal editor
Test Coverage
I tested this by resizing the window while the number, text, multiline text, and angle blocks were being edited, on desktop Chrome, mobile Safari, and mobile Chrome on Android. On both mobile browsers, I also tested rotating the device while these fields were being edited.
I also tested in the multi_playground to ensure this fix works with multiple workspaces present and in RTL mode. I also checked that the context menu (which uses the widget div) closes still when resizing.
Documentation
No, but the
modalInputs
option hasn't been documented yet. It is probably better that way since it wasn't really usable before this fix, but I'll add that to my todo list.Additional Information
I'm investigating a UI bug that appears in text fields in RTL mode. I'm not sure why this code would cause it, so I need to check if it's happening on develop before I merge this. After investigation, this issue is happening on develop as well (though not on the published playgrounds on GitHub or App Engine) so I'll open a separate issue for that.