-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🪟 New <TagInput /> #17760
🪟 New <TagInput /> #17760
Conversation
344c2ce
to
f8c7fe8
Compare
cc065a4
to
83634b2
Compare
Working on cleaning up failing tests, but ready for a look over! |
name={name} | ||
render={(arrayHelpers) => ( | ||
<Field name={name} defaultValue={property.default || []}> | ||
{() => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formik says it's deprecating the render prop on Field
...provided, | ||
maxWidth: "100%", | ||
display: "flex", | ||
background: `${styles.backgroundColor}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick to use not hard-coded values 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
02ffec3
to
4579985
Compare
* WIP add creatable * appease the compiler * working on it * more work * adding and removing tags works * handle delimiters * component works, testing WIP * mostly working, add tests * cleanup tests * styling of tag items * note to self * cleanup * cleanup some more, delete old components * update style exports and render method * taginput into a describe block * find the tag input in service form tests * cleanup * use simplified queryselector * Update airbyte-webapp/src/components/ui/TagInput/TagInput.module.scss Co-authored-by: Vladimir <[email protected]> Co-authored-by: Vladimir <[email protected]>
What
closes #10985
<CreatableSelect/>
NOTE: For this iteration, we will not be implementing using a newline character as a delimiter due to HTML input elements stripping newline characters.
How
The
Control
component houses the field and field value themselves, passing in anonChange
function that updates the fieldValue when called. TheTagInput
uses the fieldValue to generate a list ofTag
s (each having an id, label, and value that are important for the internals of the component). When a user action triggers the creation of a New Tag (a comma, semicolon, tab, or enter), we call theonChange
which updates the field value, which triggers the creation of a new Tag as well.Recommended reading order
TagInput.tsx
Control.tsx
TagInput.test.tsx