mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
fix: do not hide all chaff when resizing (#6916)
This commit is contained in:
committed by
GitHub
parent
2fa7280ce1
commit
2bbb3aa1fc
@@ -729,6 +729,28 @@ export abstract class Field<T = any> implements IASTNodeLocationSvg,
|
||||
protected showEditor_(_e?: Event): void {}
|
||||
// NOP
|
||||
|
||||
/**
|
||||
* A developer hook to reposition the WidgetDiv during a window resize. You
|
||||
* need to define this hook if your field has a WidgetDiv that needs to
|
||||
* reposition itself when the window is resized. For example, text input
|
||||
* fields define this hook so that the input WidgetDiv can reposition itself
|
||||
* on a window resize event. This is especially important when modal inputs
|
||||
* have been disabled, as Android devices will fire a window resize event when
|
||||
* the soft keyboard opens.
|
||||
*
|
||||
* If you want the WidgetDiv to hide itself instead of repositioning, return
|
||||
* false. This is the default behavior.
|
||||
*
|
||||
* DropdownDivs already handle their own positioning logic, so you do not need
|
||||
* to override this function if your field only has a DropdownDiv.
|
||||
*
|
||||
* @returns True if the field should be repositioned,
|
||||
* false if the WidgetDiv should hide itself instead.
|
||||
*/
|
||||
repositionForWindowResize(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the size of the field based on the text.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user