311-data icon indicating copy to clipboard operation
311-data copied to clipboard

Would like a clear way to reset the NC selection

Open edwinjue opened this issue 1 year ago • 1 comments

@ajmachado42 reported:

  • [ ] There isn't a clear way to reset the NC selection--hitting exit and clicking on somewhere like the ocean doesn't work which was what I intuitively thought to do.

image

edwinjue avatar Oct 12 '22 23:10 edwinjue

The short-term solution is to props-drill this.reset from Map.jsx to the desired component so it can be called there.

However, the long-term solution may be a bit more involved. That is, it may require us to implement a custom event listener within Map.jsx that calls this.reset. That way the custom event can be emitted from anywhere in the codebase to trigger the call by triggering the listener.

In case anybody else on the team can get to it before me, see: Using custom events in React

There is also some code in the react-toastify codebase that could provide some inspiration on how this can be accomplished: https://github.com/fkhadra/react-toastify/blob/main/src/core/eventManager.ts

edwinjue avatar Oct 22 '22 04:10 edwinjue