textarea

package
v0.0.0-...-c88107b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Textarea

type Textarea struct {
	*js.Object
}

Textarea provides wrapper functions for <textarea> object

func (*Textarea) Focus

func (t *Textarea) Focus()

Focus sets focus to the control

func (*Textarea) GetSelectionEnd

func (t *Textarea) GetSelectionEnd() int

GetSelectionEnd returns selection end utf8 byte position Note that JavaScript strings are UTF-16-encoded, and selectionStart returns a position in the UTF-16 array representing the textarea value

func (*Textarea) GetSelectionStart

func (t *Textarea) GetSelectionStart() int

GetSelectionStart returns selection start utf8 byte position Note that JavaScript strings are UTF-16-encoded, and selectionStart returns a position in the UTF-16 array representing the textarea value

func (*Textarea) GetSymbolWidthsAround

func (t *Textarea) GetSymbolWidthsAround(before, after int) (wBefore, wAfter int)

GetSymbolWidthsAround returns the size of the unicode symbols in utf8 bytes before and after a given utf8 byte range in a string

func (*Textarea) GetSymbolsAroundSelection

func (t *Textarea) GetSymbolsAroundSelection() (before, after string)

GetSymbolsAroundSelection returns one symbol before and one symbol after selection (or around the caret, if there's no selection); one or both strings can be empty if caret is placed at the beginning or the end of the document, or if the document is blank

func (*Textarea) GetValue

func (t *Textarea) GetValue() string

GetValue returns current textarea value (text)

func (*Textarea) InsertText

func (t *Textarea) InsertText(text string)

InsertText replaces selection with the provided text And adjusts the caret pos

func (*Textarea) SetHeight

func (t *Textarea) SetHeight(val int)

SetHeight sets textarea height in pixels

func (*Textarea) SetSelectionEnd

func (t *Textarea) SetSelectionEnd(val int)

SetSelectionEnd sets selection end character

func (*Textarea) SetSelectionStart

func (t *Textarea) SetSelectionStart(val int)

SetSelectionStart sets selection start character

func (*Textarea) SetState

func (t *Textarea) SetState(val string, selStart, selEnd int)

SetState sets textarea value (text) and selection

func (*Textarea) SetValue

func (t *Textarea) SetValue(val string)

SetValue sets textarea value (text) while preserving selection

func (*Textarea) WrapSelection

func (t *Textarea) WrapSelection(begin, end string)

WrapSelection wraps selection with the provided starting and ending text snippets and places the caret before the `end` part

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL