With the removal of the shadow DOM boundary from atom-text-editor elements, event.target could sometimes report the hidden input inside the editor instead of the element itself. This caused the line-ending-selector:convert-to-CRLF and line-ending-selector:convert-to-LF commands to stop working because they were relying on event.target being an instance of TextEditorElement.
This pull request fixes it by using event.target.closest('atom-text-editor') instead, and by making tests more realistic to ensure that similar regressions can be caught in the future.
Refs: https://github.com/atom/atom/issues/13189
With the removal of the shadow DOM boundary from
atom-text-editor
elements,event.target
could sometimes report the hidden input inside the editor instead of the element itself. This caused theline-ending-selector:convert-to-CRLF
andline-ending-selector:convert-to-LF
commands to stop working because they were relying onevent.target
being an instance ofTextEditorElement
.This pull request fixes it by using
event.target.closest('atom-text-editor')
instead, and by making tests more realistic to ensure that similar regressions can be caught in the future./cc: @atom/core