Resolve Firefox issues (#981)

* Resolve Firefox issues

* use firefox hack only for empty c-e divs
This commit is contained in:
Peter Savchenko 2019-12-03 20:30:50 +03:00 committed by GitHub
parent 755f4291f3
commit 964652de5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 6 deletions

8
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,9 @@
# Changelog
### 2.16.1
- `Fix` — Fix Firefox bug with incorrect height and cursor position of empty content editable elements [#947](https://github.com/codex-team/editor.js/issues/947) [#876](https://github.com/codex-team/editor.js/issues/876) [#608](https://github.com/codex-team/editor.js/issues/608) [#876](https://github.com/codex-team/editor.js/issues/876)
### 2.16
- `Improvements` — Inline Toolbar design improved
@ -10,7 +14,7 @@
`New` *Inline Tools API* — Ability to specify Tool's title via `title` static getter.
- `Fix` — On selection from end to start backspace is working as expected now [#869](https://github.com/codex-team/editor.js/issues/869)
`Fix` — Fix flipper with empty dom iterator [#926](https://github.com/codex-team/editor.js/issues/926)
- `Fix` — Normalize node before walking through children at `isEmpty` method [943](https://github.com/codex-team/editor.js/issues/943)
- `Fix` — Normalize node before walking through children at `isEmpty` method [#943](https://github.com/codex-team/editor.js/issues/943)
`Fix` — Fixed Grammarly conflict [#779](https://github.com/codex-team/editor.js/issues/779)
`Improvements` — Module Listeners now correctly removes events with options [#904](https://github.com/codex-team/editor.js/pull/904)
`Improvements` — Styles API: `.cdx-block` default vertical margins decreased from 0.7 to 0.4 ems.

View file

@ -1,6 +1,6 @@
{
"name": "@editorjs/editorjs",
"version": "2.16.0",
"version": "2.16.1",
"description": "Editor.js — Native JS, based on API and Open Source",
"main": "dist/editor.js",
"types": "./types/index.d.ts",

View file

@ -16,6 +16,18 @@
outline: none;
width: 100%;
box-sizing: border-box;
/**
* Workaround Firefox bug with cursor position on empty content editable elements with ::before pseudo
* https://bugzilla.mozilla.org/show_bug.cgi?id=904846
*/
&[data-placeholder]::before {
position: static !important;
display: inline-block;
width: 0;
white-space: nowrap;
pointer-events: none;
}
}
/**

View file

@ -14,6 +14,14 @@
&--hidden {
display: none;
}
/**
* Workaround firefox bug: empty content editable elements has collapsed height
* https://bugzilla.mozilla.org/show_bug.cgi?id=1098151#c18
*/
[contenteditable]:empty::after {
content: "\feff ";
}
}
/**