material-components / material-components/material-web

Textfield stays "disabled" if Vue ref changes

Open
#5,874 3 comments 0 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

### What is affected?

Component

### Description

We were using `^1.4.1` of the textfield so far, but this also applies to the more recent "^2.4.1".

If we set the `disabled` flag to a Vue ref, it will be disabled, even if the underlying Vue ref starts with `false`:

```html

```
It would only flip to "enabled" if some later user activity flips the value again.

Only if we remove `:disabled`, the input field will start as "enabled".

Interestingly, flipping the disabled flag had worked fine for months, but now shows this weird behaviour.

### Reproduction

The input field should recognize the "disabled" flag as it has been set by Vue.

### Workaround

Removing "disabled" altogether.

### Is this a regression?

Yes. This used to work, but now it doesn't.

### Affected versions

1.4.1, 2.4.1

### Browser/OS/Node environment

Browser: Chrome 142.0.7444.177 (Official Build) (arm64)
OS: macOS Sequoia

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 reproducing the issue in the textfield component with a Vue ref initialized to false, then observe how the disabled state is applied and updated. The work is done when the field starts enabled and responds correctly when the ref changes, across the affected versions or a current reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.