mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Implement detachment to eliminate spurious drag events
This commit is contained in:
committed by
Antonio Scandurra
parent
173cdcb372
commit
ebad2e6605
@@ -599,7 +599,18 @@ class TextEditorComponent {
|
||||
}
|
||||
})
|
||||
this.intersectionObserver.observe(this.element)
|
||||
if (this.isVisible()) this.didShow()
|
||||
if (this.isVisible()) {
|
||||
this.didShow()
|
||||
} else {
|
||||
this.didHide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
didDetach () {
|
||||
if (this.attached) {
|
||||
this.didHide()
|
||||
this.attached = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ class TextEditorElement extends HTMLElement {
|
||||
this.emitter.emit('did-attach')
|
||||
}
|
||||
|
||||
detachedCallback () {
|
||||
this.getComponent().didDetach()
|
||||
}
|
||||
|
||||
getModel () {
|
||||
return this.getComponent().getModel()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user