quill icon indicating copy to clipboard operation
quill copied to clipboard

Bubble toolbar is out of view when Cmd-A "select all" is used on a large document.

Open chadsteele opened this issue 6 months ago • 0 comments

Bubble toolbar is out of view when Cmd-A "select all" is used on a large document.

I'd like to make it sticky and in view in general, but especially if the user can't find it.

I suspect the solution is here, but it's not obvious to me https://github.com/slab/quill/blob/ebe16ca24724ac4f52505628ac2c4934f0a98b85/packages/quill/src/themes/bubble.ts#L95

  position(reference: Bounds) {
    const shift = super.position(reference);
    const arrow = this.root.querySelector('.ql-tooltip-arrow');
    // @ts-expect-error
    arrow.style.marginLeft = '';
    if (shift !== 0) {
      // @ts-expect-error
      arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;
    }
    return shift;
  }
}

chadsteele avatar Apr 28 '25 17:04 chadsteele