[SearchBox][FeatureRequest]Request to add 'setSelectionRange' public function to ISearchBox interface
In some cases, when searchBox is mounted with predefined value, and needs to be focused (manually call searchBoxRef.focus() or by using FocusTrapZone). The cursor in SearchBox is set to the beginning.
See this simple codpen demo.
To controll the selection range, could we public APIs like setSelectionRange(), setSelectionStart(), setSelectionEnd() to ISearchBox? AFAIK, the TextField component has such functions in ITextField
We've talked many times about SearchBox extending the TextField component as they share a LOT of functionality like this. Though TextField is a bit too opinionated about styles, and SearchBox would have to override a ton of them.
We might want to abstract the common functionality out into another component and let TextField and SearchBox be a styled implementation of that component, like we do with BaseButton and the various styled buttons.
Sadly, TextField is a great name for that base component. Maybe we'd call the base TextInput, or BaseTextField.
I.E. I'd rather not keep copying functionality between two components. Let's focus on uniting them.
@micahgodbolt Totally agree with you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!
This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! Why am I receiving this notification?