Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabled prop #1

Open
juanpasolano opened this issue Aug 31, 2017 · 2 comments
Open

disabled prop #1

juanpasolano opened this issue Aug 31, 2017 · 2 comments

Comments

@juanpasolano
Copy link

Hi there,
Is there any option to make the "input field" disabled?

@tiffon
Copy link
Owner

tiffon commented Sep 9, 2017

Hey, thanks for pointing this out... Not having a handy "disabled" prop is a pretty big omission. I'll look into adding it.

In the meantime, you can add pointer-events: none to the editable DOM element, which will effectively disable it, via the setEditableProps prop.

So, something like this would be uneditable:

<TxRegionsInput
    setEditableProps={{ style: { pointerEvents: 'none'} }}
    placeholder="Firstname"
    preset="email"
/>

You could add styling to it via the className prop in the setEditableProps:

<TxRegionsInput
    setEditableProps={{ className: 'disabled-form-input', style: { pointerEvents: 'none'} }}
    placeholder="Firstname"
    preset="email"
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@juanpasolano @tiffon and others