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

Wrong popup position #47

Open
ggunia opened this issue Nov 24, 2021 · 1 comment
Open

Wrong popup position #47

ggunia opened this issue Nov 24, 2021 · 1 comment

Comments

@ggunia
Copy link

ggunia commented Nov 24, 2021

Problem

I want to show the browser-action-list inside the browserView which could be located anywhere on the screen. ( Lets call it containerView )

When user clicks on the browser-action it calculates the position of the popup window by getting the boundingRectangle of the html element.

As a result popup is opened in a wrong position on the screen because it doesn't consider bounds of the containerView

Possible solution

Add offset properties to the browser-action-list component that will be added to the boundingRectangle coordinates.

<browser-action-list offset-x="100" offset-y="150"></browser-action-list>

@ggunia ggunia changed the title (Feature request) Intercept open/close event of the Popup (Feature request) Wrong popup position Nov 24, 2021
@ggunia ggunia changed the title (Feature request) Wrong popup position Wrong popup position Nov 24, 2021
@samuelmaddock
Copy link
Owner

The 'browser-action-popup-created' event is emitted once one is created. Would it be possible for you to adjust the position within an event listener?

Alternatively, logic to check the container bounds could be added to the code which positions the popup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants