From 9b70cf2044fa81ff7af7367770f1e5785e5c7358 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 4 Nov 2014 13:58:34 -0700 Subject: [PATCH] Make blur event on text editor element work with shadow DOM disabled When the shadow DOM is enabled, this happens organically because the focus is abstracted across the shadow boundary. Without that abstraction boundary, we need to pretend that a blur of the hidden input is actually a blur of the entire editor. Signed-off-by: Max Brunsfeld --- src/text-editor-element.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index 12c4ee615..5a39f8348 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -95,6 +95,7 @@ class TextEditorElement extends HTMLElement lineOverdrawMargin: @lineOverdrawMargin ) @component = React.renderComponent(@componentDescriptor, @rootElement) + @component.refs.input.getDOMNode().addEventListener 'blur', => @dispatchEvent(new FocusEvent('blur', bubbles: false)) unmountComponent: -> return unless @component?.isMounted()