Closed tom-un closed 1 year ago
Hmm, it looks like this "somewhat" works for me in 0.64
release using iOS clearButtonMode
prop.
The "X" appears but not on every interaction it clears the input. It also appear that button re-activation after interaction could be quite a slow process in some cases:
This is a bit weird, but it looks like that pressing on the right side of the icon increase the chance for the successful clear.
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Issue
On iOS the
enableClearButton
prop on TextInput shows an ⓧ. On macOS it is not implemented.This will not be entirely trivial to implement on macOS. The NSTextField has no built-in support for icons on the left or right. There is the NSSearchField
but it has no affordance to modify the left icon.
To get a cancel button in the RCTUITextField (the NSTextField subclass for single line TextInput) we would have to make an implementation similar to NSSearchField and add sub NSCell's to be the clear button. At the same time, we could add a new macOS specific prop to add a left-hand image also using an NSCell.
Steps to Reproduce
In RNTester go to the TextInput Example "Clear button mode" example.
iOS:
macOS: