-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add Initial Support For Creation in Choices Inputs #6163
Conversation
135280c
to
6766b71
Compare
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! I think we're missing an option in ReferenceInput that would handle the creation automatically. But let' do that in another PR.
expect(queryByRole('progressbar')).toBeNull(); | ||
}); | ||
|
||
test('should support creation of a new choice through the onCreate event', async () => { |
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.
please use it
as previous
/> | ||
); | ||
|
||
expect(queryByRole('progressbar')).toBeNull(); | ||
}); | ||
}); | ||
|
||
test('should support creation of a new choice through the onCreate event', async () => { |
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.
please test with 'it'
).not.toBeNull(); | ||
}); | ||
|
||
test('should support creation of a new choice through the onCreate event with a promise', async () => { |
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.
same
onCreate: (choice: any) => void; | ||
onCancel: () => void; | ||
} | ||
export const useCreateSuggestion = () => useContext(CreateSuggestionContext); |
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.
bad name, as it does not actually create anything
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.
You have a better one?
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.
useCreateSuggestionContext
?
4a84094
to
1f45d01
Compare
1f45d01
to
9f89713
Compare
Messed up my commits/rebase big time 😭 |
SelectInput
AutocompleteInput
ReferenceInput
AutocompleteArrayInput
ReferenceArrayInput
SelectArrayInput