@lvce-editor/virtual-dom 1.30.0 → 1.32.0

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.
package/dist/index.js CHANGED
@@ -718,7 +718,10 @@ const rememberFocus = ($Viewlet, dom, eventMap, uid = 0) => {
718
718
  if (focused) {
719
719
  const $NewFocused = $New.querySelector(`[name="${focused}"]`);
720
720
  if ($NewFocused) {
721
- $NewFocused.replaceWith($Hidden.firstChild);
721
+ const $Previous = $Hidden.firstChild;
722
+ $Previous.className = $NewFocused.className;
723
+ $Previous.placeholder = $NewFocused.placeholder;
724
+ $NewFocused.replaceWith($Previous);
722
725
  }
723
726
  }
724
727
  $Hidden.remove();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/virtual-dom",
3
- "version": "1.30.0",
3
+ "version": "1.32.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -43,9 +43,14 @@ export const rememberFocus = (
43
43
  }
44
44
  $Viewlet.replaceWith($New)
45
45
  if (focused) {
46
- const $NewFocused = $New.querySelector(`[name="${focused}"]`)
46
+ const $NewFocused = $New.querySelector(
47
+ `[name="${focused}"]`,
48
+ ) as HTMLInputElement
47
49
  if ($NewFocused) {
48
- $NewFocused.replaceWith($Hidden.firstChild as HTMLElement)
50
+ const $Previous = $Hidden.firstChild as HTMLInputElement
51
+ $Previous.className = $NewFocused.className
52
+ $Previous.placeholder = $NewFocused.placeholder
53
+ $NewFocused.replaceWith($Previous)
49
54
  }
50
55
  }
51
56
  $Hidden.remove()