@onehat/ui 0.3.188 → 0.3.189

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": "@onehat/ui",
3
- "version": "0.3.188",
3
+ "version": "0.3.189",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -745,15 +745,15 @@ export function ComboComponent(props) {
745
745
  }
746
746
 
747
747
  }}
748
- onAdd={(entity) => {
749
- if (entity?.id !== value && !isInTag) {
748
+ onAdd={(selection) => {
749
+ const entity = selection[0];
750
+ if (entity.id !== value && !isInTag) {
750
751
  // Select it and set the value of the combo.
751
- setGridSelection([entity]);
752
- const id = entity.id;
753
- setValue(id);
752
+ setGridSelection(selection);
753
+ setValue(entity.id);
754
754
  }
755
755
  if (onGridAdd) {
756
- onGridAdd([entity]);
756
+ onGridAdd(selection);
757
757
  }
758
758
  }}
759
759
  onSave={(selection) => {
@@ -761,9 +761,8 @@ export function ComboComponent(props) {
761
761
  if (entity?.id !== value && !isInTag) { // Tag doesn't use value, so don't do this comparison in the Tag
762
762
  // Either a phantom record was just solidified into a real record, or a new (non-phantom) record was added.
763
763
  // Select it and set the value of the combo.
764
- setGridSelection([entity]);
765
- const id = entity.id;
766
- setValue(id);
764
+ setGridSelection(selection);
765
+ setValue(entity.id);
767
766
  }
768
767
  if (onGridSave) {
769
768
  onGridSave(selection);