mirror of
https://github.com/atom/atom.git
synced 2026-02-17 01:51:54 -05:00
Add comment explaining motivation for didPaste implemenation
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user