This is a migrated thread and some comments may be shown as answers.

Popup is unable to find it's anchor only for Functional component.

2 Answers 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vinod
Top achievements
Rank 1
Vinod asked on 15 Jul 2019, 12:21 PM

Hi,

I only use Functional Component in my application. I want to use Popup control in my application, Popup control successfully finds its anchor for Class component but in the case of Functional component, the Popup is unable to find it's anchor and it always displays in the Top-left corner. 

Please refer to attachment. For clarity, I have highlighted the Position of Popup for Functional as well as Class Component. 

Thanks in advance.

Regards,

Vinod

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Jul 2019, 12:07 PM
Hello, Vinod,

I can assume that this is due to the way the ref are set with functional components.

I made an example with the Popup in functional component with hooks, and the Popup is positioned as expected:

https://stackblitz.com/edit/react-nlprqp?file=app/main.jsx

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Vinod
Top achievements
Rank 1
answered on 17 Jul 2019, 04:49 AM
Thanks Stefan. This definitely helps. It indeed was an issue on my ref. 
Tags
General Discussions
Asked by
Vinod
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Vinod
Top achievements
Rank 1
Share this question
or