motion icon indicating copy to clipboard operation
motion copied to clipboard

Configure the order of the gesture's priority list

Open Elia-Darwish opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. Recently, I encountered a use case where I needed the onTap to have a higher priority than onFocus. And while I was able to achieve that using theuseAnimation hook, I think it would be great if I was able to configure this somewhere.

Describe the solution you'd like I believe, it would be great if we could pass the priorities to the MotionConfig component to override the default behavior. Maybe something like this...

const priorities = ["animate", "while-hover", "while-tap", "while-focus", "exit"]

function App() {
  return (
    <MotionConfig priorities={priorities} >
    ...
    </MotionConfig>
  )
}

Describe alternatives you've considered using the useAnimation hook to manage the order myself.

Elia-Darwish avatar Mar 18 '21 14:03 Elia-Darwish

We've since set whileFocus to be a lower priority so hopefully this fixes it, but I don't think we'll be making the order configurable.

mattgperry avatar Nov 24 '21 16:11 mattgperry