Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

stimulus-uppercaseable-input

1.0.6 • Public • Published

npm codebeat badge

Stimulus Uppercaseable Input

This is a simple StimulusJS controller that forces any element that emits an input event to allow only uppercase letters.

JSFiddle Demo.

Install

This assumes that StimulusJS is already installed.

Add the stimulus-uppercaseable-input module:

$ yarn add stimulus-uppercaseable-input

or

$ npm install stimulus-uppercaseable-input

Basic Usage

First, register the controller with StimulusJS:

// application.js
import { Application } from 'stimulus';
import { UppercaseableInput } from 'stimulus-uppercaseable-input';
 
const application = Application.start();
application.register("uppercaseable-input", UppercaseableInput);

Next, you need an input element that emits an input event to attach the controller to:

<form>
    <input data-controller="uppercaseable-input" type="text" />
</form>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/stephendolan/stimulus-uppercaseable-input. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

This package is available as open source under the terms of the MIT License.

install

npm i stimulus-uppercaseable-input

Downloadsweekly downloads

23

version

1.0.6

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability