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

InputPicker styles are less specific than Picker styles #3328

Closed
ab-pm opened this issue Aug 9, 2023 · 1 comment · Fixed by #3334
Closed

InputPicker styles are less specific than Picker styles #3328

ab-pm opened this issue Aug 9, 2023 · 1 comment · Fixed by #3334

Comments

@ab-pm
Copy link

ab-pm commented Aug 9, 2023

What version of rsuite are you using?

5.28.3

Describe the Bug

rsuite/InputPicker/styles/index.less defines

.rs-picker-input {
  …
  .rs-picker-toggle {
    …
    cursor: text;
  }
}

which is meant to override the cursor: pointer style that is defined on the .rs-picker-default .rs-picker-toggle selector. However, it comes after the latter in the generated .css file, so it does not actually apply the cursor: text to the element.
Unfortunately I cannot quite figure out where the .rs-picker-default .rs-picker-toggle selector comes from (I'm new to .less) but my guess is that this specificity issue is caused by the alphabetical import order in rsuite/styles/index.less. It should import the common/default styles first, the specific modules later?

Expected Behavior

The <InputPicker> should have a text cursor.

@ab-pm ab-pm changed the title InputPicker styles do not overwrite Picker styles InputPicker styles are less specific than Picker styles Aug 9, 2023
@SevenOutman
Copy link
Member

@ab-pm Thanks for raising this!

It could probably be caused by the order of the class declarations. But after inspecting the CSS overrides, I guess the .rs-picker-default .rs-picker-toggle here might be just redundant here as we already specified cursor: pointer for general picker toggles with .rs-picker-toggle class.

image

I'll look into how we should fix this.

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

Successfully merging a pull request may close this issue.

2 participants