quill
quill copied to clipboard
Safari: getBounds returns incorrect position if there's a Cursor blot under cursor.
Steps for Reproduction
- Open Safari
- Visit quilljs.com
- 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
For a REAL WORLD example to reproduce this bug:
- Open Safari
- Visit quilljs.com
- Select all and delete
- Press Cmd+B
- Press Enter multiple times
Expected behavior:
The cursor stays in the viewport.
Actual behavior:
Page scroll to the top.