Commit b93374c6 authored by Nicolas Pouillard's avatar Nicolas Pouillard

[AnnotatedField] setRef before setMenu

parent 2e469b5c
...@@ -76,8 +76,8 @@ annotatedFieldComponent = R.hooksComponentWithModule thisModule "annotatedField" ...@@ -76,8 +76,8 @@ annotatedFieldComponent = R.hooksComponentWithModule thisModule "annotatedField"
, onClose: \_ -> R.setRef menuRef Nothing , onClose: \_ -> R.setRef menuRef Nothing
, setList , setList
} }
setMenu $ const menu
R.setRef menuRef menu R.setRef menuRef menu
setMenu $ const menu
mapCompile (Tuple t l) = {text: t, list: l, onSelect} mapCompile (Tuple t l) = {text: t, list: l, onSelect}
compiled = map mapCompile $ compile ngrams text compiled = map mapCompile $ compile ngrams text
...@@ -127,11 +127,11 @@ maybeShowMenu setMenu menuRef setTermList ngrams event = do ...@@ -127,11 +127,11 @@ maybeShowMenu setMenu menuRef setTermList ngrams event = do
list = findNgramTermList ngrams n list = findNgramTermList ngrams n
setList t = do setList t = do
setTermList n list t setTermList n list t
--setMenu (const Nothing)
R.setRef menuRef Nothing R.setRef menuRef Nothing
--setMenu (const Nothing)
E.preventDefault event E.preventDefault event
range <- Sel.getRange sel 0 range <- Sel.getRange sel 0
log2 "[maybeShowMenu] selection range" $ Sel.rangeToTuple range --log2 "[maybeShowMenu] selection range" $ Sel.rangeToTuple range
let menu = Just { let menu = Just {
x x
, y , y
...@@ -140,8 +140,8 @@ maybeShowMenu setMenu menuRef setTermList ngrams event = do ...@@ -140,8 +140,8 @@ maybeShowMenu setMenu menuRef setTermList ngrams event = do
, onClose: \_ -> R.setRef menuRef Nothing , onClose: \_ -> R.setRef menuRef Nothing
, setList , setList
} }
setMenu $ const $ menu
R.setRef menuRef menu R.setRef menuRef menu
setMenu $ const $ menu
Nothing -> pure unit Nothing -> pure unit
-- Nothing -> do -- Nothing -> do
-- R.setRef menuRef Nothing -- R.setRef menuRef Nothing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment