Open gidili opened 5 years ago
This is one of those things that either has a solution that can be googled and implemented in 20 minutes, or isn't worth doing.
@rgerkin this is a conservative estimates and it's not more about the implementation that is quite trivial and will be described below, it's more about the fact that this will have to be copy-pasted (almost) in all the components that use the dialog component. The implementation itself consists in creating a function that get the event.target and check if the dialog ref contains the event.target, depending on this condition the component's state will be updated accordingly to reflect the open/close dialog state. This function will be then hooked to the mouse event 'mousedown' in the componentDidMount.
From @rgerkin: Currently only "Close" closes the lightbox. In many UIs, just clicking outside of the lightbox closes it. This would be an improvement if it is easy to do.