Repository navigation
feat(text-input)!: rename TextInput.Icon size to iconSize #5262
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1824,14 +1824,41 @@ | |
| }); | ||
| }); | ||
|
|
||
| it('takes the glyph size from `size`, not `iconSize`', async () => { | ||
| it('sizes the TextInput.Icon glyph with `iconSize`', async () => { | ||
| await render( | ||
| <TextInput | ||
| label="Search" | ||
| value="" | ||
| startAccessory={(props) => ( | ||
| // @ts-expect-error `iconSize` is not a TextInput.Icon prop | ||
| <TextInput.Icon {...props} icon="magnify" size={30} iconSize={12} /> | ||
| <TextInput.Icon | ||
| {...props} | ||
| iconSize={12} | ||
| icon={({ size }) => ( | ||
| <View testID="glyph" style={{ width: size, height: size }} /> | ||
| )} | ||
| /> | ||
| )} | ||
| /> | ||
| ); | ||
|
|
||
| expect(screen.getByTestId('glyph', includeHiddenElements)).toHaveStyle({ | ||
| width: 12, | ||
| height: 12, | ||
| }); | ||
| }); | ||
|
|
||
| it('rejects the named `size` on TextInput.Icon', async () => { | ||
| await render( | ||
| <TextInput | ||
| label="Search" | ||
| value="" | ||
| startAccessory={(props) => ( | ||
| <TextInput.Icon | ||
| {...props} | ||
| icon="magnify" | ||
| // @ts-expect-error `size` is not a TextInput.Icon prop | ||
| size="small" | ||
| /> | ||
|
Check notice on line 1861 in src/components/__tests__/TextInput.test.tsx
|
||
|
Comment on lines
+1851
to
+1861
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🆕 🔵 Nit · "rejects the named The test named "rejects the named Suggested change Keep the Detailspersona: Useful? Reply Reply |
||
| )} | ||
| /> | ||
| ); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.