Fix issue where editor fails to regain focus #13412

Merged
merged 2 commits into from Dec 9, 2016

Projects

None yet

3 participants

@maxbrunsfeld
Contributor
maxbrunsfeld commented Dec 9, 2016 edited

When changing the workspace's pane configuration, the PaneContainer needs to sometimes remove intermediate PaneAxis objects from the DOM. When it does this, it tries to restore focus to the previously-focused node.

This stopped working for text editors when we removed the shadow DOM because when a text editor is focused, it transfers focus to its hidden input element. This hidden input element was destroyed and re-created every time the editor was detached and re-attached.

This PR solves that problem by making the TextEditorElement keep a long-lived reference to a hidden input element, and re-using that same hidden input element every time it is attached to the DOM.

🍐 'd with @damieng

Fixes #13206

maxbrunsfeld added some commits Dec 9, 2016
@maxbrunsfeld @damieng maxbrunsfeld Make each atom-text-editor keep a consistent hidden input node for it…
…s lifetime

Signed-off-by: Damien Guard <damieng@github.com>
efd2077
@maxbrunsfeld @damieng maxbrunsfeld Remove InputComponent.getDomNode method
Access the dom node directly in TextEditorElement instead

Signed-off-by: Damien Guard <damieng@github.com>
6f4a506
@damieng damieng merged commit cf20aef into master Dec 9, 2016

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@damieng damieng deleted the dg-mb-fix-editor-focus-issue branch Dec 9, 2016
@nathansobo
Contributor

⚡️ Thanks guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment