Add comment explaining motivation for didPaste implemenation

This commit is contained in:
Jason Rudolph
2017-08-07 12:43:13 -04:00
parent b9ace6a5b6
commit 3dc2e61990

View File

@@ -1553,7 +1553,12 @@ class TextEditorComponent {
}
didPaste (event) {
// TODO Explain the motivation for this logic
// On Linux, Chromium translates a middle-button mouse click into a
// mousedown event *and* a paste event. Since Atom supports the middle mouse
// click as a way of closing a tab, we only want the mousedown event, not
// the paste event. And since we don't use the `paste` event for any
// behavior in Atom, we can no-op the event to eliminate this issue.
// See https://github.com/atom/atom/pull/15183#issue-248432413.
if (this.getPlatform() === 'linux') event.preventDefault()
}