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

Doesn't works properly when browser zoom !== 100% #81

Closed
HondaHiroyuki opened this issue Jan 13, 2018 · 16 comments
Closed

Doesn't works properly when browser zoom !== 100% #81

HondaHiroyuki opened this issue Jan 13, 2018 · 16 comments
Labels

Comments

@HondaHiroyuki
Copy link

Resizing by dragging gutters doesn't work correctly on Microsoft Edge and Internet Explorer.
Resized result doesn't match the amount of dragging operation.

It can be seen in all the examples on the documentation site.

Split.js seems to work, but I'd like to use this module if it's supposed to support these Windows browsers.
Thanks.

@bertrandg bertrandg added the bug label Jan 15, 2018
@alexfeds
Copy link

alexfeds commented Jan 22, 2018

would be nice to have the library working in Internet Explorer. I think just because this library using FlexBox Layout, its not working properly in IE. Would be nice instead of FlexBox layout to use Bootstrap 3 grid system??

@bertrandg
Copy link
Contributor

yes, you 're right.
I need to take time to test and fix it asap!

@bertrandg
Copy link
Contributor

@HondaHiroyuki
I've just test it on IE11 and it works.. I had to add some polyfill on the website angular-cli config to view it on IE but that was an other issue now fixed.

But I have an idea on what's going on with your bug. Maybe your browser isn't with zoom 100% ?
Can you check it again please: https://bertrandg.github.io/angular-split/

@alexfeds
This lib is 100% based on flexbox, so that's only for browser supporting it.. but compatibility is pretty good:
https://caniuse.com/#feat=flexbox

@alexfeds
Copy link

@bertrandg Thanks for suggesting. I am creating enterprise application that mostly be used on Internet Explorer 7-11. So that's why I am using Bootstrap 3 for gridding. Can you point me in a direction on how can I create splitter library that will be based on Bootstrap 3 layout. So instead of flexbox I replace it with Bootstrap. Any advice appreciate

@HondaHiroyuki
Copy link
Author

@bertrandg
Thank you for your reply.

As you say, the problem seems to be caused by the zoom setting of browsers, not by browsers.
I'm using a HiDPI display, and the default zoom setting of IE and Edge is 250%.
When I set the zoom to 100%, the resizing problem did not occur, although the page size became quite small and difficult to read.

I also found that it occurred even on any other browsers when I changed the zoom setting.

Is it possible to consider the zoom setting of browsers on resizing?
It would be very nice if this module could support it.

@bertrandg
Copy link
Contributor

@HondaHiroyuki Thanks for the feedbacks, I will investigate about that. Issue not there using Split.js so there should be a workaround..

@alexfeds Wow, do you know that IE7 & 8 are not compatible with angular:
https://angular.io/guide/browser-support
Bootstrap is used for 'static grid' but you can use floating div with fixed pixel/percent sizes if you want to build your own.

@bertrandg bertrandg changed the title Resizing not working correctly on Edge and IE Doesn't works properly when browser zoom !== 100% Jan 25, 2018
@tkglaser
Copy link

@bertrandg I would do a PR but can't for various reasons. This is probably a one-line fix.
in private drag() of the SplitComponent just divide offsetPixel by window.devicePixelRatio. Maybe a try-catch around it.

https://stackoverflow.com/a/37815031

Would be really nice to get this fixed as I'd like to use it for a project. :)

@bertrandg
Copy link
Contributor

Yep, I will try to test and implement it this weekend! ;)

@bertrandg
Copy link
Contributor

@tkglaser @HondaHiroyuki @alexfeds

Done in angular-split@1.0.0-rc.3 :)
you can directly test on the website:
https://bertrandg.github.io/angular-split/#/examples/nested-split

Please report me if it works correctly now on your devices before I close the issue.

@tkglaser
Copy link

tkglaser commented Feb 1, 2018

@bertrandg Works great, many thanks!

@bertrandg
Copy link
Contributor

Seems this change breaks behavior on mobile: #85
I wiil try to fix it but will remove devicePixelRatio use if no solution.. :(

@HondaHiroyuki
Copy link
Author

@bertrandg
On my device, now it does not work correctly except on IE and Edge.

On my Windows,
【IE, Edge】
default zoom: 250%
devicePixelRatio: 2.5
【Chrome, Firefox】
default zoom: 100%, but the page size is scaled according to the DPI scaling setting of Windows
devicePixelRatio: 2.5

On the browsers that support HiDPI scaling internally, not by the default zoom setting, devicePixelRatio is not consistent with the browser zoom, which causes the resizing problem.

I think that the solution is to use clientX/clientY instead of screenX/screenY in calculating the amount of dragging operations, without using devicePixelRatio.

While screenX/screenY returns the device pixel value, clientX/clientY returns the CSS pixel value, so perhaps you don't have to care about the browser zoom, DPI scaling, or devicePixelRatio.

Could you please check if the solution works?
It should also solve #85.

@Mysame
Copy link

Mysame commented Jul 24, 2018

Fixed in my branch
https://github.com/Mysame/angular-split

Forked from https://github.com/aszechlicki/angular-split to also include rxjs6

Also fixes #85

@ribizli
Copy link

ribizli commented Aug 1, 2018

@Mysame how do you use this forked package then in your project? Have you published it into NPM under a different name? Or are you using a private NPM repo like Nexus? Or just installing from a directory?

@Mysame
Copy link

Mysame commented Aug 1, 2018

@ribizli At the moment of posting, I'm using my version by copying over the module to my project.
I have no intention of making an NPM package out of a bugfix.

@bertrandg
Copy link
Contributor

Ok using version 2.0.0 I've just released.

@angular-split angular-split locked and limited conversation to collaborators Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants