Commit 48d78cc8 authored by Robert Knight's avatar Robert Knight

Add note about mechanism preventing Hypothesis UI clicks from closing sidebar

This mechanism is not especially obvious, so add a comment to explain it.
parent 34521471
......@@ -328,6 +328,11 @@ export class Guest extends TinyEmitter implements Annotator, Destroyable {
_setupElementEvents() {
// Hide the sidebar in response to a document click or tap, so it doesn't obscure
// the document content.
//
// Hypothesis UI elements (`<hypothesis->`) have logic to prevent clicks in
// them from propagating out of their shadow roots, and hence clicking on
// elements in the sidebar's vertical toolbar or adder won't close the
// sidebar.
const maybeCloseSidebar = (element: Element) => {
if (this._sideBySideActive) {
// Don't hide the sidebar if event was disabled because the sidebar
......
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