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

Mousewheel event in row detail #618

Closed
meta-akshita-agrawal opened this issue Oct 29, 2020 · 11 comments · Fixed by #619
Closed

Mousewheel event in row detail #618

meta-akshita-agrawal opened this issue Oct 29, 2020 · 11 comments · Fixed by #619

Comments

@meta-akshita-agrawal
Copy link

meta-akshita-agrawal commented Oct 29, 2020

General Topic

Your Environment

Software Version(s)
Angular 9.0
Angular-Slickgrid 2.17
TypeScript 3.7

Context or Topic

Hi Author,

Thanks for making such a great library :). I am reporting the issue for the row detail feature in your library. I am unable to scroll row detail div through the mouse wheel. Once scrolled down(dragging with the pointer), it moves up with the mouse wheel but never down.
I am not sure if you have a solution for this or even this issue is any priority for you but I have tried everything and unable to get hold of this. If you have any workaround, it will be a big help.
The last option is that I apply a third party jquery plugin on the row detail div.

PS: Reproducible in the library itself

Steps to reproduce :

  1. Change row count from 9 to 5 on this line
  2. Go to the Row detail page, open any of the row detail
  3. Try to scroll div with mouse wheel event

Expected Behavior

When the pointer is in the row detail area, the mouse wheel should scroll the row detail div rather than the table div

Current Behavior

Possible Solution

What I realized that when I inspect and remove the last 2 mouse wheel slick grid events, it starts working as expected. Maybe these 2 events are preventing the inside mouse wheel event

image

@ghiscoding
Copy link
Owner

That is most probably an issue in the core lib 6pac/SlickGrid which will have to addressed in that fork not in Angular-Slickgrid. You should try to see if you can replicate the issue in the core lib Example - Row Detail, if it's reproducible there then it's in the core lib, if not then it might be in Angular-Slickgrid (but I doubt it)

@meta-akshita-agrawal
Copy link
Author

No, it's not reproducible in 6pac/Slickgrid
ezgif com-gif-maker

@ghiscoding
Copy link
Owner

I seriously have no time to look into this, so I would require your help in troubleshooting the issue. It might be something in the CSS styling (SASS in Angular-Slickgrid).

@ghiscoding
Copy link
Owner

The main difference against the core lib is that I created my own SASS styling in Angular-Slickgrid, sometime it's not fully in sync with the core lib on the styling side. You can see the full styling on this line of slick-plugins.scss file and you can also compare the styling directly in chrome. The other place to possibly look into would be the implementation of Row Detail in Angular-Slickgrid via the rowDetailViewExtension.ts, it's different compare to the core because it's specific code to load an Angular component dynamically.

I would think the issue is possibly in the SASS

@meta-akshita-agrawal
Copy link
Author

Thanks, let me dig into it.

@meta-akshita-agrawal
Copy link
Author

meta-akshita-agrawal commented Oct 29, 2020

Also, wanted to know if this is any other scroll plugin in the detail view? Because the outside scroll looks like a browser scroll and the internal one looks like some another. In the core lib, it seems that both scroll bars are browsers.
Just a thought, that the scroll plugin may have created this problem.
Can I get hold of that part of the code?

image

@ghiscoding
Copy link
Owner

I don't know why that is different, but again I think it might be CSS styling but I don't know more than that. I already gave you the 2 files to look into the SASS file or the rowDetailViewExtension.ts

@ghiscoding
Copy link
Owner

ghiscoding commented Oct 29, 2020

I strongly believe it's CSS and so I changed the Angular-Slickgrid - Row Detail demo to have the scroll and posted a question on Stack Overflow here, you can refer to that SO and maybe upvote the question. Hopefully someone can answer just by looking at the live demo.

@meta-akshita-agrawal
Copy link
Author

meta-akshita-agrawal commented Oct 30, 2020

Thanks a lot. Though I commented on different parts of the CSS and tested, none changed the issue. I also tried overriding that mouse wheel event listener, that didn't work too

ghiscoding-SE pushed a commit that referenced this issue Oct 30, 2020
- when jQuery mousewheel is imported, SlickGrid attaches a scroll handler which prevent scrolling to work as normal, this however should only be used with frozen grids since it creates other issues like seen in Row Detail were it doesn't behave correctly
- NOTE that this is more of a patch and a SlickGrid grid option flag would be better to handle that, possibly create a flag in future SlickGrid version
ghiscoding added a commit to ghiscoding/aurelia-slickgrid that referenced this issue Oct 31, 2020
- when jQuery mousewheel is imported, SlickGrid attaches a scroll handler which prevent scrolling to work as normal, this however should only be used with frozen grids since it creates other issues like seen in Row Detail were it doesn't behave correctly
- NOTE that this is more of a patch and a SlickGrid grid option flag would be better to handle that, possibly create a flag in future SlickGrid version
- ref Angular-Slickgrid issue [#618](ghiscoding/Angular-Slickgrid#618)
ghiscoding added a commit to ghiscoding/aurelia-slickgrid that referenced this issue Oct 31, 2020
- when jQuery mousewheel is imported, SlickGrid attaches a scroll handler which prevent scrolling to work as normal, this however should only be used with frozen grids since it creates other issues like seen in Row Detail were it doesn't behave correctly
- NOTE that this is more of a patch and a SlickGrid grid option flag would be better to handle that, possibly create a flag in future SlickGrid version
- ref Angular-Slickgrid issue [#618](ghiscoding/Angular-Slickgrid#618)
ghiscoding added a commit that referenced this issue Nov 2, 2020
#619)

* fix(extensions): import jQuery mousewheel only with frozen, fixes #618
- when jQuery mousewheel is imported, SlickGrid attaches a scroll handler which prevent scrolling to work as normal, this however should only be used with frozen grids since it creates other issues like seen in Row Detail were it doesn't behave correctly
- NOTE that this is more of a patch and a SlickGrid grid option flag would be better to handle that, possibly create a flag in future SlickGrid version
@ghiscoding
Copy link
Owner

Pushed a patch for this under the new release v.2.23.x. I say it's a patch since a better implementation would be to add a new flag in SlickGrid (core) to disable the mousewheel scroll handler (which is what causes this issue and was answered in the SO question), right now I'm only importing the jquery.mousewheel.js if your grid uses the frozen (pinning) feature but it's not a full fix because as soon as it loaded once it stays loaded and that will still cause the problem.

So anyway, the patch is available under the new release v.2.23.x

If you like the lib and haven't already upvoted, please do so ⭐
Thanks

ghiscoding added a commit to 6pac/SlickGrid that referenced this issue Nov 25, 2020
- when using TypeScript, we must always import the mousewheel jquery lib even if we don't need it because TypeScript does not yet support dynamic import. So providing a grid option to only use the mousewheel handler when we really want it is the only bulletproof way to only use that handler only when we really need it (typically when using a frozen grid)
- ref Angular-Slickgrid [issue](ghiscoding/Angular-Slickgrid#618)
6pac pushed a commit to 6pac/SlickGrid that referenced this issue Nov 27, 2020
…555)

* feat: add enableMouseWheelScrollHandler option to allow dynamic load
- when using TypeScript, we must always import the mousewheel jquery lib even if we don't need it because TypeScript does not yet support dynamic import. So providing a grid option to only use the mousewheel handler when we really want it is the only bulletproof way to only use that handler only when we really need it (typically when using a frozen grid)
- ref Angular-Slickgrid [issue](ghiscoding/Angular-Slickgrid#618)

* refactor: dynamically add mousewheel scrolling handler on setOptions
@ghiscoding
Copy link
Owner

ghiscoding commented Dec 2, 2020

There is now a new grid option flag called enableMouseWheelScrollHandler in the SlickGrid core lib which you can use to enable/disable the mousewheel scroll, it will automatically enable the flag when detecting the grid as being a frozen grid, any other grid will expect this flag to be disabled and won't interfere with the Row Detail plugin. There was 2 PRs made to fix this, the 1st PR was more of a temporary fix while the the 2nd one is a permanent fix.

Cheers ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants