@solidtv/solid 1.3.9-0 → 1.3.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidtv/solid",
3
- "version": "1.3.9-0",
3
+ "version": "1.3.9",
4
4
  "description": "SolidTV",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1232,7 +1232,11 @@ function updateNodeData(node: DOMNode | DOMText) {
1232
1232
  if (keyValue === undefined) {
1233
1233
  node.div.removeAttribute('data-' + key);
1234
1234
  } else {
1235
- node.div.dataset[key] = String(keyValue);
1235
+ // dataset[key] requires key to already be camelCase (DOMStringMap rejects hyphenated
1236
+ // property names outright, e.g. "section-id" -- SyntaxError: not a valid property
1237
+ // name). Our data props are passed as data-attribute-style keys (kebab-case), so use
1238
+ // setAttribute directly instead, consistent with the removeAttribute branch above.
1239
+ node.div.setAttribute('data-' + key, String(keyValue));
1236
1240
  }
1237
1241
  }
1238
1242
  }
@@ -470,7 +470,7 @@ function createVirtual<T>(
470
470
  },
471
471
  ).start();
472
472
  } else {
473
- this.lng[axis] = this.lng[axis]! + childSize * slice().shiftBy;
473
+ this.lng[axis] = (prevChildPos - active[axis]) + childSize * slice().shiftBy;
474
474
  }
475
475
  });
476
476
  };
@@ -51,7 +51,7 @@ function createKeyboardEvent(
51
51
  keyCode: number,
52
52
  eventName: string = 'keydown',
53
53
  ): KeyboardEvent {
54
- return new KeyboardEvent(eventName, {
54
+ const event = new KeyboardEvent(eventName, {
55
55
  key,
56
56
  keyCode,
57
57
  which: keyCode,
@@ -61,6 +61,18 @@ function createKeyboardEvent(
61
61
  metaKey: false,
62
62
  bubbles: true,
63
63
  });
64
+
65
+ // Chrome < 51 (LG webOS 3.x runs Chrome 38) ignores the key/keyCode/which
66
+ // members of KeyboardEventInit, so the event arrives with key '' / keyCode 0
67
+ // and the focusManager drops it. Force the values onto the instance so Magic
68
+ // Remote clicks and scrolls still map to keys on those devices.
69
+ if (event.key !== key || event.keyCode !== keyCode) {
70
+ Object.defineProperty(event, 'key', { get: () => key });
71
+ Object.defineProperty(event, 'keyCode', { get: () => keyCode });
72
+ Object.defineProperty(event, 'which', { get: () => keyCode });
73
+ }
74
+
75
+ return event;
64
76
  }
65
77
 
66
78
  const [cursorVisible, setCursorVisible] = createSignal(false);