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

fix: change default value of input type from null to text #1200

Merged
merged 5 commits into from
Apr 14, 2023

Conversation

re-fort
Copy link
Contributor

@re-fort re-fort commented Apr 11, 2023

according to W3C, when omitting the type of input(e.g. <input />), the type must be treated as text.

The missing value default is the Text state.

after #1170, that case is treated as null and is not masked correctly.
this PR resolves this.

@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2023

⚠️ No Changeset found

Latest commit: 374e187

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@re-fort
Copy link
Contributor Author

re-fort commented Apr 12, 2023

cc: @mydea

@YunFeng0817
Copy link
Member

This looks good to me. @mydea Do you think it's OK to set 'text' as the default value?

@mydea
Copy link
Contributor

mydea commented Apr 12, 2023

This should not be necessary, because input.type will already return text for <input /> - I actually fixed this in a previous PR.

IMHO I would not do this change, because right now it will return null only when called on non-input elements, which IMHO is safer than to have e.g. getInputType(divElement) === 'text'?

I fixed this here: #1184 - maybe we can/should just add a comment indicating that input.text will default to text?

@re-fort
Copy link
Contributor Author

re-fort commented Apr 13, 2023

@mydea
ah, sorry.
i couldn't have checked your previous PR properly.
i've just added a comment in this PR.

and it would be helpful if you could also consider releasing rrweb@2.0.0-alpha.8

@YunFeng0817 YunFeng0817 merged commit 94d0653 into rrweb-io:master Apr 14, 2023
@YunFeng0817
Copy link
Member

@re-fort 2.0.0-alpha.8 has been released!

@re-fort re-fort deleted the fix-input-default-type branch April 17, 2023 06:29
eoghanmurray pushed a commit to eoghanmurray/rrweb that referenced this pull request Jul 27, 2023
)

* fix: change default value of input type from null to text

* Apply formatting changes

* add changeset

* add a comment related to the type of input element
eoghanmurray pushed a commit to eoghanmurray/rrweb that referenced this pull request Jul 27, 2023
)

* fix: change default value of input type from null to text

* Apply formatting changes

* add changeset

* add a comment related to the type of input element
eoghanmurray pushed a commit to eoghanmurray/rrweb that referenced this pull request Jul 27, 2023
)

* fix: change default value of input type from null to text

* Apply formatting changes

* add changeset

* add a comment related to the type of input element
eoghanmurray pushed a commit to eoghanmurray/rrweb that referenced this pull request Aug 3, 2023
)

* fix: change default value of input type from null to text

* Apply formatting changes

* add changeset

* add a comment related to the type of input element
eoghanmurray pushed a commit to eoghanmurray/rrweb that referenced this pull request Aug 8, 2023
)

* fix: change default value of input type from null to text

* Apply formatting changes

* add changeset

* add a comment related to the type of input element
eoghanmurray pushed a commit to eoghanmurray/rrweb that referenced this pull request Aug 8, 2023
)

* fix: change default value of input type from null to text

* Apply formatting changes

* add changeset

* add a comment related to the type of input element
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.

3 participants