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(time-input): readonly fix #724

Merged
merged 6 commits into from
May 3, 2019
Merged

fix(time-input): readonly fix #724

merged 6 commits into from
May 3, 2019

Conversation

montezume
Copy link
Contributor

@montezume montezume commented May 2, 2019

This PRd does two things

  • Properly support the isReadOnly prop for the TimeInput component.
  • Refactor TimeInput component to use design tokens and to be themeable.

NOTE: Until we merge 10.0.0, a themed TimeInput looks a bit weird because the icons aren't themable.

Closes #723

Copy link
Contributor

@tdeekens tdeekens left a comment

Choose a reason for hiding this comment

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

Looks cool. I especially like the PR‘s summary and description.

@montezume
Copy link
Contributor Author

@tdeekens I opened it as a draft so I could see the Percy diff and finish it up. 😢

value={this.props.value}
onChange={this.props.onChange}
onFocus={this.props.onFocus}
onBlur={this.props.onBlur}
{...filterDataAttributes(this.props)}
/* ARIA */
role="textbox"
aria-readonly={this.props.isReadOnly}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as we do in the TextInput

@@ -20,7 +20,7 @@ const getIconTheme = (isDisabled, isMouseOver) => {
export const ClearSection = props => (
<div
onClick={props.isDisabled || props.isReadOnly ? undefined : props.onClear}
css={getClearSectionStyles(props)}
css={theme => getClearSectionStyles(props, theme)}
Copy link
Contributor

Choose a reason for hiding this comment

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

If only if was curried :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

at least I have VRT to catch my mistakes 🙈

@montezume
Copy link
Contributor Author

Just need to refactor the icons to use colors from css instead of Icon Themes to make theming work

@montezume
Copy link
Contributor Author

montezume commented May 2, 2019

Actually a better way would just be to support Icon Theming. I'll do it in another PR though and put this on hold until then 🎈

@montezume montezume marked this pull request as ready for review May 3, 2019 09:27
@montezume montezume self-assigned this May 3, 2019
@montezume montezume added the 🐛 Type: Bug Something isn't working label May 3, 2019
@montezume montezume requested a review from emmenko May 3, 2019 09:27
@montezume montezume force-pushed the ml-time-input-readonly branch from 00c28c3 to f609809 Compare May 3, 2019 10:55
@montezume montezume merged commit 19ac8c6 into master May 3, 2019
@montezume montezume deleted the ml-time-input-readonly branch May 3, 2019 12:04
jonnybel pushed a commit that referenced this pull request May 6, 2019
* fix(time-input): readonly fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimeInput doesn't support isReadOnly
2 participants