mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Keep cursor in view for text controls
When editing or changing the selection inside an <input> or <textarea>, we should scroll the container so the cursor is always visible. Note that currently the cursor might still become invisible at the end of the container since we do not reserve enough space for it to be made visible.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
9d09b3ce34
commit
2d4728d353
Notes:
github-actions[bot]
2026-02-11 10:18:42 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/2d4728d3536 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7839
@@ -236,6 +236,7 @@ public:
|
||||
// ^FormAssociatedTextControlElement
|
||||
virtual void did_edit_text_node(FlyString const& input_type, Optional<Utf16String> const& data) override;
|
||||
virtual GC::Ptr<DOM::Text> form_associated_element_to_text_node() override { return m_text_node; }
|
||||
virtual GC::Ptr<DOM::Element> text_control_scroll_container() override { return m_inner_text_element; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#has-a-periodic-domain/
|
||||
bool has_periodic_domain() const { return type_state() == HTMLInputElement::TypeAttributeState::Time; }
|
||||
|
||||
Reference in New Issue
Block a user