Comments (10)
@luckashenri not checked yet, just quick assumption that router remove elements from DOM. Maybe just init inside body will fix. I will check in few days.
from panes.
@roman-rr I tried with diff version, but still no luck.
Something interesting is that after calling 'scrollElementInit' it does work to scroll down, but when I scroll up it brings the panel together.
Well keep trying at the meantime and keep u posted.
from panes.
@luckashenri Thank you again, I've checked.
calcFitHeight()
method should be used for Auto Height panes with settings.fitHeight = true
;
The fitHeight: true
option will assign method calcFitHeight()
for instance.
In your case, you just want to scroll up on each new page?
from panes.
@roman-rr I found out something interesting..
Not sure if u're familiar with angular, or any other framework like that.. But basically when I put the 'overflow-y' attribute in a upper level, it will render the inner data correctly with scroll.
When I do it inside each inner page, it will work for first one only, and then break.
In this example, the pages have their own custom header, and custom body. In that case, the scroll breaks cause it needs to recalc everytime I switch page (that's what I think).
example 2:
In this second example, I have the page changing INSIDE the overflow-y div.. In that case, even changing the height of inner content, it works nicely..
But in this case, I can't have a custom header like in first example.
from panes.
@luckashenri Would you like to recalculate height of overflow-y
element on page changes?
- Have you tried
setOverflowHeight()
method ? - Have you checked this example ? Here overflow element recalculated dynamically.
If nothing works, your example still relevant ? I may try to do this right on this example ? Or you have to adjust this example with headers ?
from panes.
I don't want the overflow-y to recalc it necessarely, it's just that I noticed that it loses the height once I move to another page for some reason, I thought recalculating would fix, but it caused the scroll affecting the drawer as well. (like I explain below answering ur second question).
1 - Yes, it didn't have any effect.
2 - Yes, I tried something similar calculating manually the height. It kinda works but then the action of scrolling inner scroll also affects the drawer as a whole. When I scroll it also drags the drawer.
Yeah that project I sent is still valid. In fact now I added 2 modules. One with it working (but with static header). And another with dynamic header (that comes within the page) but with scroll breaking.
Seems like stackblitz doesn't want to run it lol.. I guess u'll need to clone and run it. Lemme know if it works for u.
from panes.
@roman-rr not sure it's relavant, but I noticed it shows 'cancelable: true' once it's being dragged.. The only difference I noticed so far between them.
working example (I took this screenshot before switching pages, so I could check how was the states before breaking):
from panes.
@luckashenri thank you for details, I'll check in couple days
from panes.
@luckashenri Thank you for interesting case!
Actually, angular remove elements from DOM and all events also removed.
Moreover, for new element scroll have to be re-initialized and events re-attached.
Solution
Change your function to:
ngAfterViewInit() {
this.router.events.pipe(
filter(event => event instanceof NavigationEnd)
).subscribe({
next: async (value) => {
await new Promise(resolve => requestAnimationFrame(resolve));
this.myPane.scrollElementInit();
this.myPane.checkOverflowAttr(this.myPane.breakpoints.currentBreakpoint);
this.myPane.events.detachAllEvents();
this.myPane.events.attachAllEvents();
},
});
}
Not a simple case, if there are more such re-renders for overflow-y element in the future, I will make some scoped functions to manage events re-attachments around the scroll element.
from panes.
@roman-rr Yeah just got a chance to test it, it worked!!
I just ran some tests and profilers and seems like that won't have an impact on performance as well. Thanks man!
from panes.
Related Issues (20)
- [FEAT] Update changelog & Add husky to project HOT 3
- [FEAT] Add husky to project
- [BUG] ion-select-options appear behind the pane, select itself doesnt. HOT 3
- [BUG] z-Index issue or request to set it manually. HOT 2
- [FEAT] Close all panes on hardware back button event HOT 2
- [BUG] modal appears and overlaps screen if parentElement is gone HOT 1
- [BUG] fitHeight not set height HOT 6
- [FEAT]
- [BUG] calcFitHeight need some time to calc correctly HOT 1
- [BUG] Panes cannot be dragged in Chrome HOT 4
- [BUG] swipe down and close pane on iframe HOT 1
- [FEAT] Is it possible to display pane with horizontal offset by default HOT 3
- [BUG] fitHeight + calcFitHeight incorrect size when changed content inside via v-if in vuejs 3
- [BUG] Vite uglify modules names HOT 2
- [FEAT] Sponsorship packages
- [FEAT] AI initiatives
- [FEAT] Space Video
- Vue.js 3 example HOT 5
- [FEAT] Tracking & Analytics for product improvement
- Pane Break Points dont work as expected when changing screen layout HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panes.