material-components / material-components/material-web

Add "readonly" to interactive form controls like checkbox and switch

Open
#4,914 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
11.3k
Forks
1.1k
Avg merge
20h 28m
Merged PRs (30d)
13

Description

I need the property readonly in elements textfield, textarea, switch, and select so I can focus and click on these element and initialize some stuff, even with attribute readonly set.
Property disabled isn't for me because it prohibits all interactions on the element.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementations and tests for textfield, textarea, switch, and select, then compare their current readonly and disabled behavior. Define the expected focus and click behavior for each control, implement the property consistently, and verify that readonly controls remain interactive while disabled controls do not.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.