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

Influx: Query segment menus now position correctly near the bottom of the screen #60087

Merged
merged 2 commits into from Dec 14, 2022

Conversation

ashharrison90
Copy link
Contributor

@ashharrison90 ashharrison90 commented Dec 9, 2022

What is this feature?

  • only open the Select menu once options have loaded
  • this allows the Select menu to calculate where to position itself correctly
Screenshare.-.2022-12-09.11_59_55.AM.mp4

Why do we need this feature?

  • prevent menu overflowing the screen when positioned near the bottom

Who is this feature for?

  • anyone using influx!

Which issue(s) does this PR fix?:

Fixes #59676
Fixes #44319
Fixes #43239

Special notes for your reviewer:

For context:

it looks like the select menu doesn't correctly calculate the position when you default isOpen to true. i'm guessing because the options are populated asynchronously? i think it positions the menu based on the initial content (which is basically nothing). so on first render, the content is empty. then the options get populated and the menu grows. if you change this line to something like isOpen={!loadState.loading}, it positions correctly.

that might be a good enough fix, or you might want the select menu to be open all the time. if that's the case, you'll probably need to trigger a rerender of the select component somehow.

@ashharrison90 ashharrison90 merged commit bb2ecb1 into main Dec 14, 2022
@ashharrison90 ashharrison90 deleted the ash/influx-select-placement branch December 14, 2022 09:51
grafanabot pushed a commit that referenced this pull request Dec 14, 2022
… the screen (#60087)

* only open the menu once options are loaded for better positioning

* use !loadState.loading instead of Boolean(loadState.value)

(cherry picked from commit bb2ecb1)
ashharrison90 added a commit that referenced this pull request Dec 14, 2022
…bottom of the screen (#60291)

Influx: Query segment menus now position correctly near the bottom of the screen (#60087)

* only open the menu once options are loaded for better positioning

* use !loadState.loading instead of Boolean(loadState.value)

(cherry picked from commit bb2ecb1)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
GuYounes pushed a commit to paul-wurth/BIXpert that referenced this pull request Feb 8, 2023
…bottom of the screen (grafana#60291)

Influx: Query segment menus now position correctly near the bottom of the screen (grafana#60087)

* only open the menu once options are loaded for better positioning

* use !loadState.loading instead of Boolean(loadState.value)

(cherry picked from commit bb2ecb1)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment