$ go get -u github.com/gopherjs/gopherjs
$ go get -u github.com/siongui/gopherjs-input-suggest
Example
+++++++
See demos first. The following is key point in the code.
Demo_ (no CSS framework)
Demo-Bulma_ (with Bulma 0.9.0)
HTML_:
.. code-block:: html
The parent of input element is set to position: relative;. Also do not use
text-align: center; in parent/ancestor element of input element.
Go_:
.. code-block:: go
BindSuggest("word", func(w string) []string {
// suggestion function implemented by you
return frozenTrie.GetSuggestedWords(w, 30)
})
See example <example>_ directory for complete example.
Control Suggest Menu Behavior by Outside Widget
+++++++++++++++++++++++++++++++++++++++++++++++
Two methods UpdateSuggestion and HideSuggestion are exported so that outside
widget such as virtual Pali keypad can control the behavior of the suggest menu.
The reason why Pali keypad need this is that when users click the button on the
Pali keypad, no keyboard events are fired so that suggest menu will not be
updated or hidden automatically. As a result, Pali keypad has to update or hide
the suggest menu manually by these two methods.
UNLICENSE
+++++++++
Released in public domain. See UNLICENSE_.
References
++++++++++
.. [1] GopherJS - A compiler from Go to JavaScript <http://www.gopherjs.org/>_
(GitHub <https://github.com/gopherjs/gopherjs>__,
GopherJS Playground <http://www.gopherjs.org/playground/>_,
|godoc|)
.. [2] Element.classList - Web APIs | MDN <https://developer.mozilla.org/en/docs/Web/API/Element/classList>_
.. [3] javascript set left position <https://www.google.com/search?q=javascript+set+left+position>_
`HTML DOM Style left Property - W3Schools <http://www.w3schools.com/jsref/prop_style_left.asp>`_
.. [4] javascript min width <https://www.google.com/search?q=javascript+min+width>_
`HTML DOM Style minWidth Property - W3Schools <http://www.w3schools.com/jsref/prop_style_minwidth.asp>`_
.. [5] GitHub - siongui/godom: Make DOM manipultation in Go as similar to JavaScript as possible. (via GopherJS) <https://github.com/siongui/godom>_
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
GitHub account BufferZoneCorp published sleeper packages that later added credential theft, GitHub Actions tampering, fake go wrappers, and SSH persistence.