Ensure 0-height editors are correctly detected as visible

This is unlikely but it’s easy enough to support

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This commit is contained in:
Nathan Sobo
2017-02-08 15:23:00 -07:00
committed by Thomas Johansen
parent 25db2bad04
commit cc4c437f3d

View File

@@ -128,7 +128,8 @@ class TextEditorComponent
didAttach: ->
@intersectionObserver = new IntersectionObserver((entries) =>
if entries[entries.length - 1].intersectionRatio isnt 0
{intersectionRect} = entries[entries.length - 1]
if intersectionRect.width > 0 or intersectionRect.height > 0
@becameVisible()
)
@intersectionObserver.observe(@domNode)