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

Fix readonly input groups #2057

Merged
merged 4 commits into from
Jun 19, 2019
Merged

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jun 18, 2019

While working on #2049, I noticed that we don't currently account for the readonly state when using prepend/append.

This PR, passes the readOnly to the EuiFormControlLayout and applies the correct styling. This means also having to explicitly state and use it as a prop for EuiFieldNumber, EuiFieldText, and EuiSelect. These are also the only ones that currently support prepend/append.

Before
Screen Shot 2019-06-18 at 19 20 24 PM

After
Screen Shot 2019-06-18 at 19 21 12 PM

Checklist

  • This was checked in mobile
  • This was checked in IE11
  • This was checked in dark mode
  • Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • [ ] This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
  • [ ] This was checked against keyboard-only and screenreader scenarios
  • [ ] This required updates to Framer X components

@cchaos cchaos force-pushed the fix-readonly-input-groups branch from 7c39adc to 1178843 Compare June 18, 2019 23:36
Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

👍 LGTM. I did find a misspell on a comment and maybe change the cursor on hovering the prepend, but not a show stopper:

ro

@chandlerprall
Copy link
Contributor

jenkins test this

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.

Code changes LGTM

@cchaos
Copy link
Contributor Author

cchaos commented Jun 19, 2019

maybe change the cursor on hovering the prepend

I think that is a different concern which involves: "How do we handle form rows with readOnly inputs" since there is no readOnly for form labels.

The lines below show how the example is created which is just passing a EuiFormLabel as the prepend node, so EuiFormControlLayout doesn't actually have any knowledge of what type of node is being passed. We'd need to add a readOnly or otherwise disabled prop to EuiFormLabel.

<EuiFormControlLayout
readOnly
prepend={<EuiFormLabel htmlFor="textField19">Read only</EuiFormLabel>}>

I'll leave that for another day 😉

@cchaos cchaos merged commit a3276cd into elastic:master Jun 19, 2019
@cchaos cchaos deleted the fix-readonly-input-groups branch June 19, 2019 18:55
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.

3 participants