fix: allow input focus when readonly#5014
Merged
chasestarr merged 3 commits intouber:masterfrom Aug 29, 2022
selfdocumentingcode:master
Merged
fix: allow input focus when readonly#5014chasestarr merged 3 commits intouber:masterfrom selfdocumentingcode:master
chasestarr merged 3 commits intouber:masterfrom
selfdocumentingcode:master
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e9e4adb:
|
chasestarr
reviewed
Aug 9, 2022
Collaborator
chasestarr
left a comment
There was a problem hiding this comment.
Sorry to let this sit for a while. This change looks good to me, but we've converted over to typescript. Do you mind updating to that?
Author
|
No worries. I will, but it'll have to be next week. |
Author
|
@chasestarr Hi. I updated the .tsx files. |
chasestarr
approved these changes
Aug 29, 2022
Collaborator
|
Thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4992
Description
Input and Textarea fields cannot be focused if the readOnly prop is true.
This prevents the read-only fields from visually showing that they are focused and also makes them no longer emit
focusandblurevents.This behavior is correct for fields with disabled attribute, but not for fields with readonly attribute.
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly#attribute_interactions
Sandbox: https://codesandbox.io/s/base-web-input-forked-7f9vwc?file=/src/example.js
Scope
Patch: Bug Fix