Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete: Ability to position overlay #7611

Open
mindaugasb-isense opened this issue Jan 16, 2025 · 1 comment
Open

Autocomplete: Ability to position overlay #7611

mindaugasb-isense opened this issue Jan 16, 2025 · 1 comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add

Comments

@mindaugasb-isense
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/primereact/autocomplete/autocomplete.esm.js b/node_modules/primereact/autocomplete/autocomplete.esm.js
index 7ccf156..9bfd60b 100644
--- a/node_modules/primereact/autocomplete/autocomplete.esm.js
+++ b/node_modules/primereact/autocomplete/autocomplete.esm.js
@@ -728,7 +728,7 @@ var AutoComplete = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(functio
     props.onHide && props.onHide();
   };
   var alignOverlay = function alignOverlay() {
-    var target = props.multiple ? multiContainerRef.current : inputRef.current;
+    var target = props.overlayTarget || (props.multiple ? multiContainerRef.current : inputRef.current);
     DomHandler.alignOverlay(overlayRef.current, target, props.appendTo || context && context.appendTo || PrimeReact.appendTo);
   };
   var onPanelClick = function onPanelClick(event) {
diff --git a/node_modules/primereact/autocomplete/autocomplete.js b/node_modules/primereact/autocomplete/autocomplete.js
index 2fdd22c..8d7e1d6 100644
--- a/node_modules/primereact/autocomplete/autocomplete.js
+++ b/node_modules/primereact/autocomplete/autocomplete.js
@@ -737,7 +737,7 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, co
       props.onHide && props.onHide();
     };
     var alignOverlay = function alignOverlay() {
-      var target = props.multiple ? multiContainerRef.current : inputRef.current;
+      var target = props.overlayTarget || (props.multiple ? multiContainerRef.current : inputRef.current);
       utils.DomHandler.alignOverlay(overlayRef.current, target, props.appendTo || context && context.appendTo || PrimeReact__default["default"].appendTo);
     };
     var onPanelClick = function onPanelClick(event) {

This issue body was partially generated by patch-package.

@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 16, 2025
@melloware melloware changed the title It would be nice to provide a wrapper component reference for overlay aligning. Autocomplete: Ability to position overlay Jan 16, 2025
@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 16, 2025
@melloware
Copy link
Member

Why not submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants