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

Feature/core 8922 dropdown issue end of screen #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 32.0.1
Changed
- `GeoDropdown`: Fix extending the screen and scroll issues when dropdown is at the end of the screen.
## 32.0.0
New:
- `GeoTree`: Add new prop `collapsedIcon` to use custom collapsed icon
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@geoblink/design-system",
"version": "32.0.0",
"version": "32.0.1-beta.0",
"description": "Geoblink Design System for Vue.js",
"author": "Geoblink <contact@geoblink.com>",
"main": "dist/system.js",
Expand Down
4 changes: 4 additions & 0 deletions src/elements/GeoDropdown/GeoDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ export default {
const fitsBelow = popupRect.height < availableHeightBelow
const fitsAbove = popupRect.height < availableHeightAbove

if (fitsAbove && (containerRect.top + availableHeightAbove > viewport.height)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this condition mean? let's try to include the second part (containerRect.top + availableHeightAbove > viewport.height) in a constant so it's easier to read

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this check for the 4 sides? top, bottom, left and right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i think i need to add for bottom side as well. this is a condition that if the popup is higher then the container and excessing the end of screen, it detects and making the popup smaller and handles the translation

Copy link
Contributor Author

@irmakyz irmakyz Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • include second part in the constant
  • check it for 4 sides

this.verticalAxisConfig.top.translation = this.verticalAxisConfig.top.translation - (containerRect.bottom - viewport.height)
this.verticalAxisConfig.top.availableHeight = this.verticalAxisConfig.top.availableHeight - this.verticalAxisConfig.top.translation
}
// We set the config for each possible position, if fits, preferred position
// and fallback position
const configTowardsLeft = {
Expand Down