Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list: programmatic click not working #5705

Open
vdegenne opened this issue Sep 5, 2024 · 1 comment
Open

list: programmatic click not working #5705

vdegenne opened this issue Sep 5, 2024 · 1 comment

Comments

@vdegenne
Copy link
Contributor

vdegenne commented Sep 5, 2024

What is affected?

Component

Description

click method doesn't work on a link md-list-item.

Reproduction

https://lit.dev/playground/#gist=dc8128d652233e2c84c8e5a93d985ada

Workaround

One workaround is to use listItemRoot to access the anchor element:

listItem.listItemRoot.click();

However, listItemRoot is marked as protected.

Is this a regression?

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

Affected versions

2.1.0

Browser/OS/Node environment

Chrome/Firefox

@asyncLiz
Copy link
Collaborator

asyncLiz commented Sep 9, 2024

We should be able to fix this by adding a click override to forward the click, similar to the list item's focus override.

override click() {
  this.listItemRoot?.click();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants