@educarehq/solaris-ui 0.25.0 → 0.25.1

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.
@@ -5567,6 +5567,20 @@ class SolarisPopoverTriggerDirective {
5567
5567
  }
5568
5568
  });
5569
5569
  }
5570
+ getPositionOrigin() {
5571
+ // When topConnected (select / multi-select inside form-field), the CDK
5572
+ // origin must be the input box (.solaris-form-field__control-wrapper),
5573
+ // not the whole <solaris-form-field> host (which includes label + hints).
5574
+ // Otherwise the "top" fallback anchors above the label, leaving the
5575
+ // label detached instead of covered by the panel.
5576
+ if (this.solarisPopoverTopConnected()) {
5577
+ const wrapper = this.elementRef.nativeElement.querySelector(':scope > .solaris-form-field__control-wrapper');
5578
+ if (wrapper) {
5579
+ return wrapper;
5580
+ }
5581
+ }
5582
+ return this.elementRef.nativeElement;
5583
+ }
5570
5584
  createPositionStrategy() {
5571
5585
  const placement = this.solarisPopoverPlacement();
5572
5586
  const align = this.solarisPopoverAlign();
@@ -5588,7 +5602,7 @@ class SolarisPopoverTriggerDirective {
5588
5602
  }));
5589
5603
  return this.overlay
5590
5604
  .position()
5591
- .flexibleConnectedTo(this.elementRef)
5605
+ .flexibleConnectedTo(this.getPositionOrigin())
5592
5606
  .withPositions(allPositions)
5593
5607
  .withFlexibleDimensions(true)
5594
5608
  .withPush(true);
@@ -5727,7 +5741,9 @@ class SolarisPopoverTriggerDirective {
5727
5741
  }
5728
5742
  const size = {};
5729
5743
  // ElementRef is SSR-safe. offsetWidth is a read-only layout property.
5730
- const triggerWidth = this.elementRef.nativeElement.offsetWidth;
5744
+ // For topConnected, measure the control-wrapper (position origin) so the
5745
+ // panel matches the input width even if label/hint rows differ.
5746
+ const triggerWidth = this.getPositionOrigin().offsetWidth;
5731
5747
  const matchWidth = this.solarisPopoverMatchTriggerWidth();
5732
5748
  const minWidth = this.solarisPopoverMinWidth();
5733
5749
  const maxWidth = this.solarisPopoverMaxWidth();