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

Adds isDisabled prop to EuiComboBox #829

Merged
merged 5 commits into from
May 15, 2018
Merged

Conversation

snide
Copy link
Contributor

@snide snide commented May 14, 2018

Fixes #822

Adds isDisabled prop to EuiComboBox. Will properly disable the input and remove button actions on the pills, clears and dropdown arrows.

This does remove the item from screen readers since it isn't focusable. I tried a couple options but this is something sort of built into HTML and acts similar to our other inputs. I'm going to make an issue to try and think up something clever to fix this across our forms in general.

image

@snide snide requested review from chandlerprall and legrego May 14, 2018 19:18
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
This looks great, thanks for the quick turnaround! I left a small comment; feel free to address or ignore it.

@@ -578,12 +582,13 @@ export class EuiComboBox extends Component {
autoSizeInputRef={this.autoSizeInputRef}
inputRef={this.searchInputRef}
updatePosition={this.updateListPosition}
onClear={isClearable && this.clearSelectedOptions ? this.clearSelectedOptions : undefined}
onClear={(isClearable && this.clearSelectedOptions && !isDisabled) ? this.clearSelectedOptions : undefined}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts on pulling this out into a function? I feel like it might improve the readability now that there are three conditions being checked here.

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@snide
Copy link
Contributor Author

snide commented May 15, 2018

jenkins test this

@snide snide merged commit c814098 into elastic:master May 15, 2018
@snide snide deleted the combobox/disable branch May 15, 2018 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComboBox: add "disabled" or "readOnly" property
3 participants