You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to PrimeNG v21, passing appendTo through overlayOptions in overlay-based components (such as Select, MultiSelect, Menu, DatePicker, etc.) no longer works as expected.
This behavior was working correctly in previous versions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrading to PrimeNG v21, passing
appendTothroughoverlayOptionsin overlay-based components (such asSelect,MultiSelect,Menu,DatePicker, etc.) no longer works as expected.This behavior was working correctly in previous versions.
Expected Behavior
When setting:
The
appendTovalue insideoverlayOptionsshould be forwarded to the internal<p-overlay>component and applied correctly.The same expectation applies when
overlayOptions.appendTois provided via global configuration.Actual Behavior in v21
The
appendTovalue passed via:overlayOptionsinputoverlayOptions)is ignored.
Instead, the final
appendTovalue appears to be resolved only from:@Input() appendToof the component (e.g.,Select)appendTovalue coming from the base component/global configAs a result,
overlayOptions.appendTohas no effect.Investigation / Root Cause
After reviewing the source code:
Overlay-based components (e.g.,
Select,MultiSelect) extend a base component.The base component provides configuration values (including
appendTo) via global config.Inside these components,
appendTois computed using:appendToinputHowever:
overlayOptions.appendTofrom the component input is not included in the resolution logic.overlayOptions.appendTofrom global config is also not included.This leads to inconsistency because:
overlayOptionsis exposed as a supported API.appendToinside it is not respected during the final value calculation.Current Status
A PR primefaces/primeng#19388 has already been opened to address this issue for:
SelectMultiSelectHowever, since many other components internally use
Overlay, it is unclear:appendToshould be.Questions
Is ignoring
overlayOptions.appendTointentional in v21?What is the intended priority order for resolving
appendTo?appendToinput?overlayOptions.appendTo?appendTo?overlayOptions.appendTo?Should all overlay-based components follow a unified resolution strategy?
Would it be better to centralize
appendToresolution logic inside theOverlaycomponent to avoid duplication and inconsistencies?Beta Was this translation helpful? Give feedback.
All reactions