RolePicker: Fix submenu position on horizontal space overflow #50769
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Fix role picker's submenu to be shown on the left side of the menu, when there's not enough horizontal space to show it on the right.
Which issue(s) this PR fixes:
Fixes https://github.com/grafana/grafana-enterprise/issues/3462
Special notes for your reviewer:
Before:
After:
![Screenshot 2022-06-14 at 13 36 48](https://user-images.githubusercontent.com/8878045/173560552-76fa934a-0c5b-4a6b-b204-2f280eddc36f.png)
![Screenshot 2022-06-14 at 13 42 17](https://user-images.githubusercontent.com/8878045/173560556-1a7966d4-b3a7-4393-a9ae-07f1f6a6b14e.png)