Skip to content

The readOnly option is not respected for non-input tags (contenteditable is always set to true) #14

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

Closed
GitzJoey opened this issue May 4, 2018 · 5 comments
Assignees

Comments

@GitzJoey
Copy link

GitzJoey commented May 4, 2018

hi,
i'm having a problem when i set to readOnly with currency symbol on it
there's red underline on the text
capture

how to set it to false?

@AlexandreBonneau AlexandreBonneau self-assigned this May 8, 2018
@AlexandreBonneau
Copy link
Member

AlexandreBonneau commented May 8, 2018

Hey @GitzJoey, I created a codepen to reproduce your problem, however currently the readOnly option is only used to set the <input> element to read-only mode, not the other tags.

I guess I could modify AutoNumeric so that when using non-input tags and the readOnly option, the contenteditable attribute would be set to false.

@GitzJoey
Copy link
Author

GitzJoey commented May 9, 2018

yes, the common sense is if read only it should be non editable. anyway thanks very much for fast response.

@AlexandreBonneau
Copy link
Member

This is fixed in AutoNumeric v4.2.13

@AlexandreBonneau
Copy link
Member

The component needs a little bit of work too since we currently force the contenteditable prop to true when a non-input tag is detected.

@AlexandreBonneau AlexandreBonneau changed the title how to set contenteditable to false The readOnly option is not respected for non-input tags (contenteditable is always set to true) May 25, 2018
@AlexandreBonneau
Copy link
Member

Fixed in v1.2.5

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

No branches or pull requests

2 participants