@aicayzer/inkkit 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/editor.js +4 -9
  2. package/package.json +1 -1
package/dist/editor.js CHANGED
@@ -1374,9 +1374,10 @@ export class InkKitEditor {
1374
1374
  this.assertAlive();
1375
1375
  const container = this.viewportContainer ?? this.root;
1376
1376
  const top = container.scrollTop, left = container.scrollLeft;
1377
- const focused = this.literalSurface
1378
- ? this.plain.ownerDocument.activeElement === this.plain
1379
- : this.editor.ctx.get(editorViewCtx).hasFocus();
1377
+ const active = this.root.ownerDocument.activeElement;
1378
+ if (active === this.plain ||
1379
+ active === this.editor.ctx.get(editorViewCtx).dom)
1380
+ active.blur();
1380
1381
  this.ready = false;
1381
1382
  this.cancelExports();
1382
1383
  this.mediaPolicy();
@@ -1401,12 +1402,6 @@ export class InkKitEditor {
1401
1402
  this.updateSurface();
1402
1403
  this.ready = true;
1403
1404
  this.mediaPolicy();
1404
- if (focused) {
1405
- if (this.literalSurface)
1406
- this.plain.focus({ preventScroll: true });
1407
- else
1408
- this.editor.ctx.get(editorViewCtx).focus();
1409
- }
1410
1405
  container.scrollTop = top;
1411
1406
  container.scrollLeft = left;
1412
1407
  this.events.stateChanged(this.literalSurface
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicayzer/inkkit",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "A preserving Markdown editor for offline web views and the web",
5
5
  "license": "MIT",
6
6
  "type": "module",