fix(#3800): MobileSearchAutocomplete: focused style persists on blur#3801
Conversation
| return ( | ||
| <div | ||
| {...mergeProps(hoverProps, focusProps, buttonProps)} | ||
| {...mergeProps(buttonProps, focusProps, hoverProps)} |
There was a problem hiding this comment.
a bit odd that the order here actually mattered, will dig to see why. Ideally it shouldn't rely on the props merge order
There was a problem hiding this comment.
funny enough, it's due to this line here https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocus.ts#L78, it should be undefined
the reason the order mattered with it though is due to how mergeProps works with event handler merging, if you pass null as an event handler, it will remove ALL event handlers of that name
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/utils/src/mergeProps.ts#L45 typeof null is 'object' so we won't go down this path
instead, we'll fall through here https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/utils/src/mergeProps.ts#L66 and overwrite everything
I'm going to push the change to this branch
Closes #3800, Closes #3861
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: