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

EuiSelect: converted to Typescript #2694

Merged
merged 5 commits into from
Jan 3, 2020

Conversation

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

src/components/form/select/select.tsx Outdated Show resolved Hide resolved
src/components/form/select/select.tsx Outdated Show resolved Hide resolved
src/components/form/select/select.tsx Outdated Show resolved Hide resolved
src/components/form/select/select.tsx Outdated Show resolved Hide resolved
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.

Should be the last one


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