Cannot click on 'readonly' inputs / textarea
See original GitHub issueCurrent behavior:
As noted initially from this comment https://github.com/cypress-io/cypress/pull/4783#issuecomment-516174805, Cypress now errors since 3.4.1 release when attempting to click on a readonly
input or textarea.
Desired behavior:
Unlike an input being disabled
, having a readonly
attribute does not restrict clicking, focusing, selecting, or triggering events on the element. These actions should be allowed and only typing should be restricted.
Steps to reproduce: (app code and test code)
cy.get('input[readonly]`).click()
Versions
Cypress 3.4.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Make HTML Input Area Readonly but Selectable
I'm trying to get the glowing border to still show up when you click it but make the text inside uneditable. <input style='border:none; ......
Read more >HTML attribute: readonly - HTML: HyperText Markup Language
The Boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control.
Read more >Using HTML readonly attribute for <textarea> tag
readonly elements can be focused by clicking the element, while disabled elements can't be clicked at all; When navigating input elements using ...
Read more >Allow to select text on readonly input - Smart UI Components
Hi, I want to create a readonly input field, but allow the user to select+copy text in it (like it's possible is in...
Read more >HTML textarea readonly Attribute - W3Schools
The readonly attribute is a boolean attribute. When present, it specifies that a text area should be read-only. In a read-only text area,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, any update on when this change will be merged in? 😃
I updated to latest Cypress version and facing this issue of ‘readonly’ inputs while clicking the Calendar to select a date. When will this be resolved?