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

Can't inspect disabled elements #997

Open
Rich-Harris opened this issue Oct 18, 2024 · 6 comments
Open

Can't inspect disabled elements #997

Rich-Harris opened this issue Oct 18, 2024 · 6 comments
Labels
bug Something isn't working has-workaround

Comments

@Rich-Harris
Copy link
Member

Describe the bug

if i have something like <button disabled> or <input disabled> it seems i can't inspect it

Reproduction URL

some other time, sorry

Reproduction

No response

Logs

No response

System Info

next
@Rich-Harris Rich-Harris added bug Something isn't working triage Awaiting triage by a project member labels Oct 18, 2024
@dominikg
Copy link
Member

if the disabled element does not emit mouse events, it won't get selected with a mouse

.

esp firefox is known for not emitting events on disabled elements.
however you might be able to use arrow keys (down for first child of current, right for next sibling) to get to the disabled element from the parent that was selected.

@dominikg
Copy link
Member

actually mouseover works, its the click to open the editor that does not. not sure how to work around that apart from creating a mask element thats layered on top of the active element so that the click hits that instead and goes through?

@bluwy
Copy link
Member

bluwy commented Oct 29, 2024

Perhaps it's possible in the inspect state to mark all disabled elements with pointer-events: none so that the click passes through and hits the parent element?

@dominikg
Copy link
Member

you can add input[disabled].svelte-inspector-active-target {pointer-events: none} to the styles, but the behavior when moving the cursor over the element is a bit erratic then (toggling selection between parent and that element.

if you do it unconditionally, well, then it won't get selected because now mousemove doesn't hit.

Surprisingly the enter key did fire, so maybe keeping it as is and user has to use Enter to open is an ok workaround? 😬

@dominikg
Copy link
Member

switching from click to pointerdown would work. is that ok or do we need to wait for the corrosponding pointerup to see if it was "clickish" (short delta for time and coords)

@dominikg dominikg added has-workaround and removed triage Awaiting triage by a project member labels Nov 1, 2024
@dominikg
Copy link
Member

dominikg commented Nov 1, 2024

workaround is to press "Enter" while the disabled element is selected to open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-workaround
Projects
None yet
Development

No branches or pull requests

3 participants