@trops/dash-core 0.1.553 → 0.1.554

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
@@ -12794,7 +12794,12 @@ var WidgetConfigPanel = function WidgetConfigPanel(_ref) {
12794
12794
  itemSelected = _useState2[0],
12795
12795
  setItemSelected = _useState2[1];
12796
12796
  React.useEffect(function () {
12797
- if (item !== itemSelected) {
12797
+ // Only sync from the parent when the data actually differs.
12798
+ // Identity-only comparison fired on every parent re-render
12799
+ // (each edit round-trips through onChange → parent setState →
12800
+ // new item reference) and reset the input mid-keystroke,
12801
+ // making the userConfig inputs effectively untypeable.
12802
+ if (JSON.stringify(item) !== JSON.stringify(itemSelected)) {
12798
12803
  setItemSelected(function () {
12799
12804
  return item;
12800
12805
  });
@@ -12860,7 +12865,15 @@ var WidgetConfigPanel = function WidgetConfigPanel(_ref) {
12860
12865
  newItem["userPrefs"] = {};
12861
12866
  }
12862
12867
  newItem["userPrefs"][key] = value;
12863
- //setItemSelected(() => newItem);
12868
+ // Update local state immediately so the input reflects each
12869
+ // keystroke without waiting for the parent round-trip to come
12870
+ // back through props. Without this the InputText's `value` prop
12871
+ // stays at the pre-keystroke value, the typed char visibly
12872
+ // snaps away, and typing more than ~1 char per second is
12873
+ // effectively impossible.
12874
+ setItemSelected(function () {
12875
+ return newItem;
12876
+ });
12864
12877
  onChange(null, newItem);
12865
12878
  }
12866
12879