studiobakers / react-ui-toolkit

Bakers Studio's React-based UI Toolkit
MIT License
15 stars 2 forks source link

TypeaheadInput: Make sure to pass all props to Input component #220

Closed edizcelik closed 8 months ago

edizcelik commented 1 year ago

We allow any InputProp to be passed to TypeaheadInput but do not pass them all to the Input component so this can lead to swallowing of some props. For example, I can set autoFocus attribute but it isn't being passed to the Input and therefore it doesn't give me the desired functionality. We should be careful with this in general. Any component that simply extends the functionality of another, especially when we explicitly allow the same props, should never narrow down the functionality of it. This is similar to how we allow passing any arguments to Input that could be actually passed to the native input. This is actually related to the Liskov's substitution principle which is a part of the renowned SOLID principles.

ErenYLCN commented 1 year ago

I also came across this problem on Discover 😄, we want the iOS keyboard to have a blue "Go" button but since we are not able to pass enterkeyhint prop it is not currently possible. I will take this 👍🏻