-
Notifications
You must be signed in to change notification settings - Fork 843
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
add disabled prop to EuiComboBoxOption #650
Conversation
8bb68bc
to
c57ed7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just had a couple suggestions and then this looks ready to merge to me.
@@ -13,6 +13,7 @@ export default class extends Component { | |||
'data-test-subj': 'titanOption', | |||
}, { | |||
label: 'Enceladus', | |||
disabled: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the label to "Enceladus is disabled" to make the example a bit clearer?
@@ -16,4 +16,8 @@ | |||
color: $euiColorPrimary; | |||
background-color: $euiFocusBackgroundColor; | |||
} | |||
&:disabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a rule to override the hover state:
&:disabled {
color: $euiColorMediumShade;
cursor: not-allowed;
&:hover {
text-decoration: none;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Been dealing with these kinds of conflicts a lot lately. Another way to deal with this kind of stuff is to only apply hover states when &:enabled:hover
. Cuts out the need for extra specificity overwrites.
No need to do that here, just was a fun realization I had last week and wanted to share. I didn't even know enabled
was a thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good after fixing those bits CJ mentioned.
I am looking into the feasibility of replacing react-select with EuiComboBox in Kibana Visual Builder. One missing feature is the ability to disable options.
This PR just adds a disabled prop to
EuiComboBoxOption