quill icon indicating copy to clipboard operation
quill copied to clipboard

Safari: getBounds returns incorrect position if there's a Cursor blot under cursor.

Open lixiaoyan opened this issue 6 years ago • 1 comments

Steps for Reproduction

  1. Open Safari
  2. Visit quilljs.com
  3. Run the code below in the console
const Delta = Quill.import('delta')
quill.setContents(new Delta())
quill.format('bold', true)
console.log(quill.selection.getBounds(0))

Expected behavior:

On Chrome:

{"bottom":145.171875,"height":23,"left":305.5,"right":305.5,"top":122.171875,"width":0}

Actual behavior:

On Safari:

{"bottom":0,"height":0,"left":0,"right":0,"top":0,"width":0}

Platforms:

Safari 11.1 (BrowserStack)

Version:

Both 1.3.6 and 2.0.0-dev

lixiaoyan avatar Aug 29 '18 09:08 lixiaoyan

For a REAL WORLD example to reproduce this bug:

  1. Open Safari
  2. Visit quilljs.com
  3. Select all and delete
  4. Press Cmd+B
  5. Press Enter multiple times

Expected behavior:

The cursor stays in the viewport.

Actual behavior:

Page scroll to the top.

lixiaoyan avatar Sep 07 '18 06:09 lixiaoyan