hyper-undo 0.6.1 → 0.6.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # hyper-undo changelog
2
2
 
3
+ ## [0.6.2] - 2026-10-03
4
+
5
+ ### Fixed
6
+ - Cloning now preserves the values of file, checkbox, radio, and option elements
7
+
8
+
9
+
3
10
  ## [0.6.1] - 2026-09-30
4
11
 
5
12
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyper-undo",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "DOM-state undo/redo via MutationObserver inverse-op replay. Standalone or paired with hyperclayjs.",
5
5
  "keywords": [
6
6
  "undo",
@@ -7,9 +7,9 @@ const UNSUPPORTED_SELECTOR = /:(?:focus(?:-within|-visible)?|hover|active|visite
7
7
  function copyControlState(source, copy) {
8
8
  if (!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(source.tagName || '')) return
9
9
  const type = (source.getAttribute?.('type') || '').toLowerCase()
10
- if ('value' in source && 'value' in copy && source.tagName !== 'OPTION' && type !== 'checkbox' && type !== 'radio') copy.value = source.value
11
- if ('checked' in source && 'checked' in copy) copy.checked = source.checked
12
- if ('selected' in source && 'selected' in copy) copy.selected = source.selected
10
+ if ('value' in source && 'value' in copy && source.tagName !== 'OPTION' && type !== 'checkbox' && type !== 'radio' && type !== 'file') copy.value = source.value
11
+ if (source.tagName === 'INPUT' && (type === 'checkbox' || type === 'radio')) copy.checked = source.checked
12
+ if (source.tagName === 'OPTION') copy.selected = source.selected
13
13
  if (source.tagName === 'SELECT') {
14
14
  for (let i = 0; i < source.options.length; i++) copy.options[i].selected = source.options[i].selected
15
15
  }