@flowtty/core 1.0.0-alpha.4 → 1.0.0-alpha.5

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.
@@ -171,7 +171,14 @@ function refreshMeasure(inst, _Yoga) {
171
171
  inst.yogaNode.setMeasureFunc(null);
172
172
  }
173
173
  }
174
+ function detachForMove(parent, child) {
175
+ const i = parent.children.indexOf(child);
176
+ if (i < 0) return;
177
+ parent.children.splice(i, 1);
178
+ if (child.type === "box") parent.yogaNode.removeChild(child.yogaNode);
179
+ }
174
180
  function appendChild(parent, child, Yoga) {
181
+ detachForMove(parent, child);
175
182
  parent.children.push(child);
176
183
  if (child.type === "box") {
177
184
  parent.yogaNode.setMeasureFunc(null);
@@ -193,6 +200,7 @@ function removeChild(parent, child, Yoga) {
193
200
  refreshMeasure(parent);
194
201
  }
195
202
  function insertBefore(parent, child, before, Yoga) {
203
+ detachForMove(parent, child);
196
204
  const i = parent.children.indexOf(before);
197
205
  parent.children.splice(i < 0 ? parent.children.length : i, 0, child);
198
206
  if (child.type === "box") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowtty/core",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {