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: show presence and validation indication #49

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/ColorInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
hex: PropTypes.string,
alpha: PropTypes.number,
}),
markers: PropTypes.array,
presence: PropTypes.array,
}

focus() {
// todo: make the ColorPicker component support .focus()

Check warning on line 47 in src/ColorInput.js

View workflow job for this annotation

GitHub Actions / Lint & Build

Unexpected 'todo' comment: 'todo: make the ColorPicker component...'
if (this.focusRef.current && this.focusRef.current.focus) {
this.focusRef.current.focus()
}
Expand Down Expand Up @@ -85,9 +87,15 @@
}

render() {
const {type, readOnly, value, level} = this.props
const {type, readOnly, value, level, markers, presence} = this.props
return (
<FormField title={type.title} description={type.description} level={level}>
<FormField
title={type.title}
description={type.description}
level={level}
__unstable_markers={markers}
__unstable_presence={presence}
>
{value ? (
<ColorPicker
ref={this.focusRef}
Expand Down