client icon indicating copy to clipboard operation
client copied to clipboard

Search panel closes with transition when clicking "X" but not when pressing Escape

Open robertknight opened this issue 2 years ago • 4 comments

The search panel (currently behind a flag) can be closing by pressing Esc when the panel has focus or via the "X" button on the right. Clicking the "X" on the right results in the panel hiding with a transition. Pressing Esc causes the panel to instantly disappear with no transition.

The expected behavior is that there should be a transition in both cases.

Search panel close transition

The reason for the difference is that when clicking the "X", the Dialog component internally initiates the transition before notifying its parent via onClose. When pressing Esc however we immediately update state to close the sidebar panel, which prevents Dialog from getting a chance to initiate the transition. A possible solution would be for Dialog to expose a handle with a close method that triggers the close transition in the normal way.

robertknight avatar Jan 05 '24 12:01 robertknight

The root cause is the same causing https://github.com/hypothesis/client/issues/5520

A possible solution would be for Dialog to expose a handle with a close method that triggers the close transition in the normal way.

We considered this some time ago https://github.com/hypothesis/frontend-shared/issues/1178

I think I even created a POC, but I guess I had to park it due to other priorities.

acelaya avatar Jan 05 '24 13:01 acelaya

Hi robertKnight, I would like to work on this.

victuseze avatar Jan 07 '24 21:01 victuseze

Hi @robertknight & @acelaya, Can I try to solve this issue?

mustafaazad03 avatar Jan 12 '24 15:01 mustafaazad03

Thanks for the interest!

This issue is a bit more complex than it might seem and has some implications. We need to put a bit more thinking on it to see where it fits in the grand scheme of things, before we can prioritize it.

We'll share more information as soon as we have it.

acelaya avatar Jan 12 '24 15:01 acelaya