I’m creating a demo for a context menu, where if I click a part of the screen, an overlay appears with a menu list containing individual functions like cut/copy/paste.
I have created two separate states of those menu options, active and tapped.
I would like to click the menu item, with tapped appearing briefly, and then dismissing (closing) the entire overlay.
At the moment what I have managed to do is click, and the tapped state appears, but stays and I have to click outside the overlay to dismiss it.
Yes, what it does is highlights the layer I have clicked, e.g Cut, and then the overlay just stays there. I have to click outside the layer to get it dismissed, whereas the intended interaction would be that the overlay gets dismissed as soon as it receives any input.
In short, the trigger is working to invoke the overlay, but not to get rid of it.
So are you saying that you want to click on something on the new Overlay that appears, and to then have it close as a result?
If yes, then you can add a Target: Close Overlay as the Interaction on the layer that appears on the Overlay.
But if you want it to close only after the Press state, then add this Interaction on the hidden Press layer.
I’m also hoping to be able to change the state of the layer to show it has been tapped, so I have another layer underneath the layer (say, cut (Active), and cut (Tapped)) that shows upon toggling the visibility of the layer above. Problem is clicking anything on the layer now just dismisses without showing the tapped layer. I want the user to have feedback of what they’ve tapped.
I’m also hoping to be able to change the state of the layer to show it has been tapped, so I have another layer underneath the layer…
Sorry, I am losing track of which layer is which here.
Could you supply an example document of the setup you have, and what you want to achieve?
If you’d rather not share it publicly, you can email it to productsupport@sketch.com and we can take it from there. Thanks.