Skip to content

Commit e4ae86b

Browse files
tcl3awesomekling
authored andcommitted
LibWeb: Exclude visible placeholders from pointer events and selection
This matches the behavior of other engines.
1 parent 9481f62 commit e4ae86b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Libraries/LibWeb/HTML/HTMLInputElement.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,8 @@ static GC::Ref<CSS::CSSStyleProperties> placeholder_style_when_visible()
885885
text-overflow: clip;
886886
white-space: nowrap;
887887
margin-inline-start: -100%;
888+
pointer-events: none;
889+
user-select: none;
888890
)~~~"sv);
889891
}
890892
return *style;

Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ static GC::Ref<CSS::CSSStyleProperties> placeholder_style_when_visible()
413413
width: 100%;
414414
overflow: hidden;
415415
margin-inline-start: -100%;
416+
pointer-events: none;
417+
user-select: none;
416418
)~~~"sv);
417419
}
418420
return *style;

0 commit comments

Comments
 (0)