Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import MaskedInput from 'react-text-mask';
window.MaskedInput = MaskedInput;
(ns interop.masked-input
(:require [reagent.core :as r]))
(def masked-input (r/adapt-react-class js/MaskedInput))
{
...
"dependencies": {
"react-text-mask": "^5.4.3",
...
}
}
(defn masked-text-widget
[{:keys [mask value placeholder disabled on-change on-blur]}]
[masked-input/masked-input
{:mask mask
:disabled disabled
:value value
:placeholder placeholder
:on-change on-change
:on-blur on-blur}])
(def date-mask #js [#"[0-3]" #"\d" "/" #"[0-2]" #"\d" "/" #"\d" #"\d" #"\d" #"\d"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment