From 52393a138f8ad2a514047d8ac85160b351e342fd Mon Sep 17 00:00:00 2001 From: Benjamin Kniffler Date: Wed, 15 Feb 2017 10:35:45 +0100 Subject: [PATCH] Check if there is a match in adjustPosition --- lib/suggestion-portal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/suggestion-portal.js b/lib/suggestion-portal.js index e45eeff..e9976bc 100644 --- a/lib/suggestion-portal.js +++ b/lib/suggestion-portal.js @@ -118,13 +118,14 @@ class SuggestionPortal extends React.Component { adjustPosition = () => { const { menu } = this.state if (!menu) return - - if (this.matchCapture() === undefined) { + + const match = this.matchCapture(); + if (match === undefined) { menu.removeAttribute('style') return } - if (this.matchTrigger()) { + if (this.matchTrigger() || match) { const rect = position() menu.style.display = 'block' menu.style.opacity = 1