Commit 34521471 authored by Robert Knight's avatar Robert Knight

Don't close sidebar when clicking on bucket bar background

Prevent the sidebar from closing when clicking the grey background behind
buckets or toolbar buttons. Visually this background is part of the sidebar, so
it seems unexpected that clicking it closes the sidebar.  Also if a user misses
a bucket's hit target, it is annoying if the sidebar gets closed and moves the
bucket/button.

Remove the `pointer-events: none` style from the grey background behind the
bucket bar. As a result clicks on this background will go to this background
element instead of the document content behind it. Due to existing logic in the
`createShadowRoot` helper, `mousedown` events within `<hypothesis-*>` element
shadow roots have their propagation stopped and so they don't reach the code in
`Guest` which closes the sidebar.
parent 7d824030
...@@ -59,10 +59,7 @@ export default function Buckets({ ...@@ -59,10 +59,7 @@ export default function Buckets({
// https://github.com/hypothesis/client/pull/2750 // https://github.com/hypothesis/client/pull/2750
'absolute w-[23px] left-[-22px] h-full', 'absolute w-[23px] left-[-22px] h-full',
// The background is set to low opacity when the sidebar is collapsed. // The background is set to low opacity when the sidebar is collapsed.
'bg-grey-2 sidebar-collapsed:bg-black/[.08]', 'bg-grey-2 sidebar-collapsed:bg-black/[.08]'
// Disable pointer events along the sidebar itself; re-enable them in
// the list elements containing bucket buttons
'pointer-events-none'
)} )}
> >
{showUpNavigation && ( {showUpNavigation && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment