mirror of
https://github.com/codex-team/editor.js
synced 2024-05-18 14:26:48 +02:00
Merge branch 'next' into fix/caret-after-convert
This commit is contained in:
commit
1a7d0cf704
|
@ -1,18 +1,17 @@
|
|||
# Changelog
|
||||
|
||||
### 2.30.1
|
||||
### 2.30.0
|
||||
|
||||
– `New` – Block Tunes now supports nesting items
|
||||
– `New` – Block Tunes now supports separator items
|
||||
– `New` – "Convert to" control is now also available in Block Tunes
|
||||
|
||||
### 2.30.0
|
||||
|
||||
- `Improvement` — The ability to merge blocks of different types (if both tools provide the conversionConfig)
|
||||
- `Fix` — `onChange` will be called when removing the entire text within a descendant element of a block.
|
||||
- `Fix` - Unexpected new line on Enter press with selected block without caret
|
||||
- `Fix` - Search input autofocus loosing after Block Tunes opening
|
||||
- `Fix` - Block removing while Enter press on Block Tunes
|
||||
– `Fix` – Unwanted scroll on first typing on iOS devices
|
||||
- `Fix` - Unwanted soft line break on Enter press after period and space (". |") on iOS devices
|
||||
- `Fix` - Caret lost after block conversion on mobile devices.
|
||||
|
||||
### 2.29.1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@editorjs/editorjs",
|
||||
"version": "2.30.0-rc.5",
|
||||
"version": "2.30.0-rc.6",
|
||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||
"main": "dist/editorjs.umd.js",
|
||||
"module": "dist/editorjs.mjs",
|
||||
|
|
|
@ -279,8 +279,12 @@ export default class BlockEvents extends Module {
|
|||
|
||||
/**
|
||||
* Allow to create line breaks by Shift+Enter
|
||||
*
|
||||
* Note. On iOS devices, Safari automatically treats enter after a period+space (". |") as Shift+Enter
|
||||
* (it used for capitalizing of the first letter of the next sentence)
|
||||
* We don't need to lead soft line break in this case — new block should be created
|
||||
*/
|
||||
if (event.shiftKey) {
|
||||
if (event.shiftKey && !_.isIosDevice) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,11 @@ export class PopoverMobile extends PopoverAbstract<PopoverMobileNodes> {
|
|||
*/
|
||||
private history = new PopoverStatesHistory();
|
||||
|
||||
/**
|
||||
* Flag that indicates if popover is hidden
|
||||
*/
|
||||
private isHidden = true;
|
||||
|
||||
/**
|
||||
* Construct the instance
|
||||
*
|
||||
|
@ -58,18 +63,26 @@ export class PopoverMobile extends PopoverAbstract<PopoverMobileNodes> {
|
|||
super.show();
|
||||
|
||||
this.scrollLocker.lock();
|
||||
|
||||
this.isHidden = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes popover
|
||||
*/
|
||||
public hide(): void {
|
||||
if (this.isHidden) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.hide();
|
||||
this.nodes.overlay.classList.add(css.overlayHidden);
|
||||
|
||||
this.scrollLocker.unlock();
|
||||
|
||||
this.history.reset();
|
||||
|
||||
this.isHidden = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class ScrollLocker {
|
|||
/**
|
||||
* Stores scroll position, used for hard scroll lock
|
||||
*/
|
||||
private scrollPosition: null|number;
|
||||
private scrollPosition: null | number = null;
|
||||
|
||||
/**
|
||||
* Locks body element scroll
|
||||
|
|
Loading…
Reference in a new issue