Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New 2.19 bundle #1377

Merged
merged 37 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
52d919c
typo fixed (#1235)
qqqays Jul 26, 2020
33be205
Improvements: more translations added to the i18n example (#1250)
neSpecc Jul 26, 2020
1da91aa
Return the result of block.call (#1205)
jacobsmith Aug 18, 2020
05c675c
<fix> toolbar--opened overlap with certain text [issue 1196] (#1201)
flaming-cl Aug 18, 2020
49516dd
Rename initialBlock to defaultBlock (#1209)
ranemihir Aug 18, 2020
3f631c8
Fix blocks.delete with undefined index (#1182) (#1218)
stephenrichard Aug 18, 2020
86dd9b2
Fix spam clicking the tune button in Firefox (#1285)
ranemihir Aug 26, 2020
8bb7c88
Disabled unwanted I18n messages (#1282)
robonetphy Aug 26, 2020
333a3d0
Move SavedData and ValidatedData interfaces from internal types (#1251)
gohabereg Aug 27, 2020
c097a12
Upd submodules (#1287)
neSpecc Aug 27, 2020
56b5b9a
Tools destroy called when the editor is destroyed (#1264)
sis-dk Aug 27, 2020
08221c7
Bump elliptic from 6.5.2 to 6.5.3 (#1257)
dependabot[bot] Aug 27, 2020
18be7d0
Fix for input and textarea bug (#1214)
PavlovicWorkCo Aug 27, 2020
57397de
Typos changes required to be fixed on website when using the import c…
Gicehajunior Aug 27, 2020
cdb48c4
Add hidden option to toolbox (#1220)
hata6502 Aug 27, 2020
f513fdd
Add RTL support (#1248)
ImangazalievM Aug 27, 2020
0929abc
Fix i18n default configuration (#1290)
khaydarov Aug 28, 2020
274e1d1
Fixing Bug #1270 and resolve all yarn lint warning. (#1292)
robonetphy Sep 1, 2020
c1f9dd6
Stop click propagation only if click cause action (#1252)
gohabereg Sep 13, 2020
83131d6
Fixing: #843 problem with onchange callback (#1310)
robonetphy Sep 26, 2020
8a5adef
The read-only mode (#1035)
hboylan Sep 29, 2020
fdd00e3
Update submodules (#1335)
gohabereg Sep 29, 2020
274cb76
Add inlineToolbar property (#1293)
ranemihir Oct 2, 2020
b836359
Throw error only if read-only is enabled from the start (#1337)
gohabereg Oct 2, 2020
ef5f12b
Fixed the 1302 bug and improve the tab key behaviour (#1342)
robonetphy Oct 5, 2020
d5f23aa
Fix caret behaviour (#1343)
gohabereg Oct 6, 2020
1245a53
Toggle readonly on start (#1344)
gohabereg Oct 6, 2020
134f691
Bugfix/fix modification observer disable (#1340)
hata6502 Oct 7, 2020
a030072
Improve the changelog and read-only toggler (#1347)
neSpecc Oct 7, 2020
962d75a
Use activeElement if anchorNode is undefined (#1350)
gohabereg Oct 7, 2020
8c55fa6
FIx errors on enter press when several blocks selected (#1349)
gohabereg Oct 7, 2020
0037a91
Fix blocks copy in read-only (#1351)
gohabereg Oct 7, 2020
9581fc2
Fixes for 2.19 (#1356)
gohabereg Oct 12, 2020
ea6f81d
Fixes due code review (#1365)
neSpecc Oct 13, 2020
86c7df6
Fixes for release: (#1366)
neSpecc Oct 13, 2020
288edc6
upd version (#1368)
neSpecc Oct 13, 2020
447b26e
Merge branch 'master' into next-2
khaydarov Oct 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIx errors on enter press when several blocks selected (#1349)
* FIx errors on enter press when several blocks selected

* Fix for safari
  • Loading branch information
gohabereg authored Oct 7, 2020
commit 8c55fa6e5871f996e084f8a3e90569879f21db05
2 changes: 1 addition & 1 deletion dist/editor.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/components/modules/blockSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,15 @@ export default class BlockSelection extends Module {
BlockManager.insertDefaultBlockAtIndex(indexToInsert, true);
Caret.setToBlock(BlockManager.currentBlock);
_.delay(() => {
Caret.insertContentAtCaretPosition((reason as KeyboardEvent).key);
const eventKey = (reason as KeyboardEvent).key;

/**
* If event.key length >1 that means key is special (e.g. Enter or Dead or Unidentifier).
* So we use empty string
*
* @see https://developer.mozilla.org/ru/docs/Web/API/KeyboardEvent/key
*/
Caret.insertContentAtCaretPosition(eventKey.length > 1 ? '' : eventKey);
}, 20)();
}

Expand Down
7 changes: 7 additions & 0 deletions src/components/modules/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,13 @@ export default class Caret extends Module {

Array.from(wrapper.childNodes).forEach((child: Node) => fragment.appendChild(child));

/**
* If there is no child node, append empty one
*/
if (fragment.childNodes.length === 0) {
fragment.appendChild(new Text(''));
}

const lastChild = fragment.lastChild;

range.deleteContents();
Expand Down
4 changes: 0 additions & 4 deletions src/components/modules/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,6 @@ export default class UI extends Module<UINodes> {
* remove selected blocks
*/
if (BlockSelection.anyBlockSelected && !Selection.isSelectionExists) {
const selectionPositionIndex = BlockManager.removeSelectedBlocks();

Caret.setToBlock(BlockManager.insertDefaultBlockAtIndex(selectionPositionIndex, true), Caret.positions.START);

/** Clear selection */
BlockSelection.clearSelection(event);

Expand Down