Skip to content
A StimulusJS controller for forcing any input field to uppercase only.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.eslintrc.yml
.gitignore
.npmignore
LICENSE
README.md
package-lock.json
package.json
webpack.config.js
yarn.lock

README.md

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.

You can’t perform that action at this time.