mirror of
https://github.com/codex-team/editor.js
synced 2024-05-19 06:47:16 +02:00
fix(scroll): acidental scroll to top on iOS devices (#2695)
* fix scroll on ios typing * Update tsconfig.json * Update CHANGELOG.md * Update CHANGELOG.md * Update package.json * Fix popover hide method to use isHidden flag
This commit is contained in:
parent
844272656e
commit
1028577521
|
@ -1,18 +1,16 @@
|
|||
# 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
|
||||
|
||||
### 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",
|
||||
|
|
|
@ -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