material-components / material-components/material-web
md-tabs fires change event when programmatically setting activeTab(Index)
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
Just trying to manually set the active tab when I discovered that it fires the change event. Normally not an issue unless my change handler also happens to change the active tab. My understanding was that the change event only fires on user interaction, or at least the docs don't indicate otherwise.
Reproduction
Workaround
I have not found a workaround.
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
1.0.0
Browser/OS/Node environment
Browser: Edge 117.0.2045.43
OS: Windows 11 22H2
Node version: 18.18.0
npm version: 10.1.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Example Playground and reproduce the behavior in the md-tabs component using activeTabIndex and the change handler. Then trace the component's tab-selection and change-event entry points. Done means programmatic active-tab changes no longer trigger the change event, while user interaction remains covered by the relevant existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100