mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 10:42:51 +00:00
LibWeb/HTML: Correctly reset selection on type change
The selection now gets reset to the beginning of the control if the type changes from an unselectable type to a selectable type.
This commit is contained in:
parent
84e29f791c
commit
5f75558646
Notes:
github-actions[bot]
2025-04-23 06:21:13 +00:00
Author: https://github.com/skyz1
Commit: 5f75558646
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4410
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 552 additions and 0 deletions
|
@ -1470,6 +1470,7 @@ void HTMLInputElement::type_attribute_changed(TypeAttributeState old_state, Type
|
|||
// 9. If previouslySelectable is false and nowSelectable is true, set the element's text entry cursor position to the
|
||||
// beginning of the text control, and set its selection direction to "none".
|
||||
if (!previously_selectable && now_selectable) {
|
||||
set_the_selection_range(0, 0);
|
||||
set_selection_direction(OptionalNone {});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue