Skip to content

Commit

Permalink
🐛 fix(bal-modal): opening bal-modal leads to page scroll to top (#1398)
Browse files Browse the repository at this point in the history
* Create PR for #1396

* fix(modal): keep scroll position

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gery Hirschfeld <gerhard.hirschfeld@baloise.ch>
  • Loading branch information
github-actions[bot] and hirsch88 committed May 16, 2024
1 parent af5f93d commit 5d661b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-scissors-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**modal**: will keep scroll postition
2 changes: 1 addition & 1 deletion packages/core/src/utils/scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class BalScrollHandler {
}

disable() {
if (this.target) {
if (!this.disabled && this.target) {
if (balBrowser.hasWindow && balBrowser.hasDocument) {
this.x = window.pageXOffset || document.documentElement.scrollLeft
this.y = window.pageYOffset || document.documentElement.scrollTop
Expand Down

0 comments on commit 5d661b5

Please sign in to comment.