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

Don't change type property on textarea #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dhritzkiv
Copy link
Member

Previously, the code would try to set a <textarea>'s type attribute to this.type. However, a textarea element's type property is readonly, and in some environments†, an Error is thrown:

Uncaught TypeError: Cannot assign to read only property 'type' of object '#<HTMLTextAreaElement>'

Now, the code behaves more or less the same way, but skips trying to assign type to textareas.

†I haven't been able to pinpoint why it happens sometimes and not others, but one major difference is browserify vs. rollup (Errors happen when using the latter).


This is a non-breaking change. However, I have spotted some other bugs, such as not handling switching from "textarea" type to non-"textarea type (aka an input element). That fix will come in another PR, and will be a breaking change.

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

Successfully merging this pull request may close these issues.

1 participant