frontend: Index | Files

package tabsupport

import ""

Package tabsupport offers functionality to add tab support to a textarea element.


Package Files


func Add Uses

func Add(textArea *dom.HTMLTextAreaElement)

Add is a helper that modifies a <textarea>, so that pressing tab key will insert tabs.

func KeyDownHandler Uses

func KeyDownHandler(element dom.HTMLElement, event dom.Event)

KeyDownHandler is a keydown event handler for a <textarea> element. It makes it so that pressing tab key will insert tabs.

To use it, first make it available to the JavaScript world, e.g.:

js.Global.Set("TabSupportKeyDownHandler", jsutil.Wrap(tabsupport.KeyDownHandler))

Then use it as follows in the HTML:

<textarea onkeydown="TabSupportKeyDownHandler(this, event);"></textarea>

Package tabsupport imports 2 packages (graph) and is imported by 10 packages. Updated 2016-09-10. Refresh now. Tools for package owners.