npm.io
0.9.0 • Published 3 years ago

@myspace-nu/fancyinput

Licence
MIT
Version
0.9.0
Deps
0
Size
11 kB
Vulns
0
Weekly
0

fancyInput

A html text input replacement with text formatting

GitHub Code size Issues

Usage

<input type="text" class="form-control" />

<script src="../js/fancyinput.js"></script>
<script>
	let myFancyInput = new fancyInput("input");
</script>

Options

allowLineBreaks - Allow line breaks

allowLineBreaks: true

Default: false

className - Class name of the fancyinput element

className: "some-classname"

Default: "fancyinput"

classNameFocus - Class name of the fancyinput element focus state

classNameFocus: "some-classname"

Default: "focus"

copyComputedStyle - Copy computed style from the source input element

copyComputedStyle: false

Default: true

copyStyle - Copy style from the source input element

copyStyle: false

Default: true

onChange(value, evt, elm) - Event that fires when the input value changes. Used for sanatizing html and should return the sanatized html.

Author: Johan Johansson

Keywords