Skip to content

Adds isDisabled prop to EuiComboBox - #829

Merged
snide merged 5 commits into
elastic:masterfrom
snide:combobox/disable
May 15, 2018
Merged

snide merged 5 commits into
elastic:masterfrom
snide:combobox/disable

Conversation

@snide

@snide snide commented May 14, 2018

Copy link
Copy Markdown
Contributor

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

@legrego legrego left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/components/combo_box/combo_box.js Outdated
inputRef={this.searchInputRef}
updatePosition={this.updateListPosition}
onClear={isClearable && this.clearSelectedOptions ? this.clearSelectedOptions : undefined}
onClear={(isClearable && this.clearSelectedOptions && !isDisabled) ? this.clearSelectedOptions : undefined}

Copy link
Copy Markdown
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.

@chandlerprall chandlerprall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@snide

snide commented May 15, 2018

Copy link
Copy Markdown
Contributor Author

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComboBox: add "disabled" or "readOnly" property

3 participants