diff options
Diffstat (limited to 'components/script/dom/htmlinputelement.rs')
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index c94be647354..198fc302f94 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -208,6 +208,9 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { #[allow(unrooted_must_root)] #[allow(unsafe_code)] unsafe fn get_insertion_point_index_for_layout(self) -> Option<isize> { + if !(*self.unsafe_get()).upcast::<Element>().get_focus_state() { + return None; + } match (*self.unsafe_get()).input_type.get() { InputType::InputText => { let raw = self.get_value_for_layout(); @@ -716,6 +719,13 @@ impl VirtualMethods for HTMLInputElement { } } } + + fn handle_blur(&self) { + if let Some(s) = self.super_type() { + s.handle_blur(); + } + self.force_relayout(); + } } impl FormControl for HTMLInputElement {} |