Closed shaps80 closed 4 years ago
Had to lookup the API for this since I've not used it. It states:
Returning an empty configuration object causes the interaction to begin, and then end with a cancellation effect
You can use the cancellation effect from returning an empty configuration to indicate to users that it’s possible for a menu to be presented from this item, but that there are no actions to present at this particular time.
Sounds like that could be useful in some cases. Would an enum that allows for disallowed
and cancelled
to be handled be useful?
Had to lookup the API for this since I've not used it. It states:
Returning an empty configuration object causes the interaction to begin, and then end with a cancellation effect You can use the cancellation effect from returning an empty configuration to indicate to users that it’s possible for a menu to be presented from this item, but that there are no actions to present at this particular time.
Sounds like that could be useful in some cases. Would an enum that allows for
disallowed
andcancelled
to be handled be useful?
You can still reproduce that by returning true
here and then just returning a nil configuration, which is essentially what was happening before.
Do you think the API needs a more explicit action for this?
Had to lookup the API for this since I've not used it. It states:
Returning an empty configuration object causes the interaction to begin, and then end with a cancellation effect You can use the cancellation effect from returning an empty configuration to indicate to users that it’s possible for a menu to be presented from this item, but that there are no actions to present at this particular time.
Sounds like that could be useful in some cases. Would an enum that allows for
disallowed
andcancelled
to be handled be useful?You can still reproduce that by returning
true
here and then just returning a nil configuration, which is essentially what was happening before.Do you think the API needs a more explicit action for this?
Ah right I see how that would work.
The API is probably ok then if the docs explain how that works.
Ok, I've added UITableView support and updated docs. Thanks!
If you're happy with this @JosephDuffy can you merge and make a release?
Ping @JosephDuffy ?
Without this change, currently if you've conformed to the protocol, long pressing will still make an attempt to show a context menu, even if you return an empty configuration. This results in a poorer UX.
The included API addition allows you to selectively disable the long press gesture (essentially) on a per element basis.