ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

Popover: Arrow for popover doesn't appear in the correct place

Open rkl1994 opened this issue 6 years ago • 8 comments

Describe the bug While I am using component 'Popover' for a 'Shellbar onProfileClick' event, although I have set all these attribute 'placementType', 'verticalAlign' and 'horizontalAlign', 'popover' itself is in the correct place, but the arrow for popover still in the center.

To Reproduce Steps to reproduce the behavior: Here is code for my shellbar and popover Screen Shot 2020-05-08 at 10 52 28 AM

Expected behavior Arrow for popover should be in the correct place

Screenshots Screen Shot 2020-05-08 at 10 49 33 AM You can see the arrow for popover is in the center.

UI5 Web Components for React Information "@ui5/webcomponents": "^1.0.0-rc.7", "@ui5/webcomponents-fiori": "^1.0.0-rc.7", "@ui5/webcomponents-icons": "^1.0.0-rc.7", "@ui5/webcomponents-react": "^0.9.1",

rkl1994 avatar May 08 '20 02:05 rkl1994

Hi @rkl1994, thanks for submitting this issue. How does your onProfileClick function look like? It should be something like

onProfileClick = (event) => {
  popoverRef.current.openBy(e.detail.targetRef);
}

If that is the case, I'll have to forward this issue to our UI5 Web Components colleagues as the ShellBar and the Popover are both built by them.

MarcusNotheis avatar May 08 '20 06:05 MarcusNotheis

Thanks for your quick reply. Yes, this is exactly what I did in my onProfileClick. Here is the code: Screen Shot 2020-05-08 at 2 55 00 PM

rkl1994 avatar May 08 '20 06:05 rkl1994

I think I found the issue. There is a minor difference in the .openBy: If you open it on e.target, the whole ShellBar is the target, so the arrow will be in the middle of the Shell Bar. As you want to open it at the Profile Avatar, you have to use .openBy(e.detail.targetRef);, then it should work as expected. Nevertheless, I think it looks very strange that the popover content is in another place than the popover arrow - @ilhan007 any ideas?

MarcusNotheis avatar May 08 '20 07:05 MarcusNotheis

Hello @MarcusNotheis yes it's not supposed to happen, but on my side when I use event.target, instead of event.detail.targetRef both the arrow and the content are misplaced together. I checked that in the ShellBar test page where I changed the profileClick handler as mentioned. So, there should be something in addition. It would be great If the author or you can provide a sample where this is reproducible.

ilhan007 avatar May 10 '20 16:05 ilhan007

Hi @ilhan007, here's a reproducible example: https://codesandbox.io/s/strange-shannon-ojclq?file=/src/App.js Is it sufficient like that or do you need it as "pure" web component implementation?

MarcusNotheis avatar May 10 '20 18:05 MarcusNotheis

Hello @MarcusNotheis it is enough, when I set the properties as in the sample, I can reproduce it with pure web component as well. I will get back to you when I find sth.

ilhan007 avatar May 11 '20 13:05 ilhan007

as this issue is related to controls that are developed in the UI5 Web Components Repo, I'll forward this issue.

MarcusNotheis avatar Jun 15 '20 13:06 MarcusNotheis

This issue is duplicate of #2111 and is now resolved.

fifoosid avatar Aug 21 '20 11:08 fifoosid