Skip to content

EuiSelect: converted to Typescript#2694

Merged
chandlerprall merged 5 commits intoelastic:masterfrom
ffknob:convert-EuiSelect-to-TS
Jan 3, 2020
Merged

EuiSelect: converted to Typescript#2694
chandlerprall merged 5 commits intoelastic:masterfrom
ffknob:convert-EuiSelect-to-TS

Conversation

@ffknob
Copy link
Copy Markdown
Contributor

@ffknob ffknob commented Dec 18, 2019

Summary

Closes #2655

Converted EuiSelect to Typescript.

Checklist

  • Check against all themes for compatability in both light and dark modes
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@elasticmachine
Copy link
Copy Markdown
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@ffknob
Copy link
Copy Markdown
Contributor Author

ffknob commented Dec 18, 2019

Looks like there is no readonly attribute for the SelectHTML element... Typescript complained and I then exchanged it for a disabled one. Any suggestions?

@chandlerprall chandlerprall self-requested a review December 18, 2019 20:54
@chandlerprall
Copy link
Copy Markdown
Contributor

Disabling the element will exclude it from inclusion in POSTs, which would be a breaking change. There's another option presented in https://stackoverflow.com/a/23428851 , @cchaos thoughts on the design side here?

@cchaos
Copy link
Copy Markdown
Contributor

cchaos commented Dec 18, 2019

My thoughts are that allowing for readOnly was a bug. The select element inherited some styles that came with the readOnly state, but the element itself is actually still interact-able.

Screen Shot 2019-12-18 at 16 13 54 PM

Therefor readOnly was incorrect and removing it as a prop would be a bug fix. I don't think the intention for consumers to add readOnly is the same as disabling.

@chandlerprall
Copy link
Copy Markdown
Contributor

@ffknob please go ahead and remove the readOnly prop; we'll continue to allow consumers to pass disabled={true} to the component via ...rest

@ffknob
Copy link
Copy Markdown
Contributor Author

ffknob commented Dec 30, 2019

@ffknob please go ahead and remove the readOnly prop; we'll continue to allow consumers to pass disabled={true} to the component via ...rest

Removed the prop and related tests.

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

Should be the last one


import { EuiFormControlLayout } from '../form_control_layout';
interface Option extends OptionHTMLAttributes<HTMLOptionElement> {
text: string;
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.

Suggested change
text: string;
text: React.ReactNode;

@chandlerprall
Copy link
Copy Markdown
Contributor

jenkins test this

@chandlerprall chandlerprall merged commit 96be645 into elastic:master Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EuiSelect needs to be converted to TS

5 participants