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

Dropdown: component interactable in disabled div #5414

Closed
RolT opened this issue Nov 27, 2023 · 5 comments · Fixed by #5419
Closed

Dropdown: component interactable in disabled div #5414

RolT opened this issue Nov 27, 2023 · 5 comments · Fixed by #5419
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@RolT
Copy link

RolT commented Nov 27, 2023

Describe the bug

Using the dropdown component inside a <div class="p-disabled"></div> section does not work as expected. It is still possible to click on the dropdown icon.

This is a CSS issue:

svg.p-icon {
pointer-events: auto;
}

svg.p-icon {
  pointer-events: auto;
}

takes precedence over:

.p-disabled, .p-disabled * {
cursor: default;
pointer-events: none;
user-select: none;
}

.p-disabled, .p-disabled * {
    pointer-events: none;
}

so it should probably be svg.p-icon:not(p-disabled) instead.

Reproducer

https://codesandbox.io/p/sandbox/primereact-demo-forked-5dmz9y

PrimeReact version

10.0.9

React version

18.x

Language

ES6

Build / Runtime

Create React App (CRA)

Browser(s)

Firefox

Steps to reproduce the behavior

Add a Dropdown component inside <div class="p-disabled"></div>

Expected behavior

The icon should not be clickable.

@RolT RolT added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 27, 2023
@melloware
Copy link
Member

Agreed.

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 27, 2023
@melloware melloware added this to the 10.3.0 milestone Nov 27, 2023
@melloware
Copy link
Member

Just tested your scenario and svg.p-icon:not(p-disabled) does not fix it.

melloware added a commit to melloware/primereact that referenced this issue Nov 27, 2023
@melloware
Copy link
Member

I got it PR submitted

@RolT
Copy link
Author

RolT commented Nov 27, 2023

Thanks that was fast !
Yes I may have missed a dot before the class: svg.p-icon:not(.p-disabled)

@melloware
Copy link
Member

Yeah you did and that still didn't work while testing so the only thing that i could make work all the time was the .p-disabled first

@melloware melloware modified the milestones: 10.3.0, 10.2.2 Nov 27, 2023
@melloware melloware modified the milestones: 10.3.0, 10.2.2 Dec 5, 2023
melloware added a commit to melloware/primereact that referenced this issue Jan 9, 2024
melloware added a commit that referenced this issue Jan 9, 2024
* Fix #5384: TreeTable support hidden columns

* fix:#5553:TreeTable: need to be converted to data- lookups instead of className lookups

* TreeTable

* Fix #5597: TreeTable body align

* Fix #5393: Tree propagate icons to leaf nodes

* Fix #5233: Cell editor ColumnEditorOptions param fix

* Fix #5398: Slider with min value rendered incorrectly

* Fix #5340: MutliSelect emptyMessage don't add to DOM

* Fix #4190: Chip aria fixes

* Fix #5414: p-disabled for svg icons

* Fix #5424: CascadeSelect use data instead of CSS selector

* Fix #5425: CascadeSelect fix for StrictMode

* Fix #5440: InputText only print className once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants