mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
LibWeb: Skip trim trailing whitespace if user is typing
This PR stops the cursor from disappearing while typing trailing spaces in a text input box.
This commit is contained in:
parent
8545756d17
commit
b3a67ee088
Notes:
github-actions[bot]
2024-08-09 15:58:09 +00:00
Author: https://github.com/alec3660 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b3a67ee088d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1013 Reviewed-by: https://github.com/AtkinsSJ ✅
|
@ -50,6 +50,9 @@ void LineBox::trim_trailing_whitespace()
|
|||
return;
|
||||
// last_fragment cannot be null from here on down, as m_fragments is not empty.
|
||||
last_fragment = &m_fragments.last();
|
||||
auto dom_node = last_fragment->layout_node().dom_node();
|
||||
if (dom_node && dom_node->is_editable() && dom_node->document().cursor_position())
|
||||
return;
|
||||
if (!should_trim(last_fragment))
|
||||
return;
|
||||
if (last_fragment->is_justifiable_whitespace()) {
|
||||
|
|
Loading…
Reference in a new issue