jsPanel4 icon indicating copy to clipboard operation
jsPanel4 copied to clipboard

Has anyone else experienced random aspect ratio locks?

Open syonfox opened this issue 4 years ago • 8 comments

Describe the bug So Im having trouble reproducing so im just wondering if anyone knows what trigers the aspect ratio to lock in a jspanel and what might call it. is there a sound way to detect and unlock the aspect ratio (i know thats hacky but easiest :))

Desktop (please complete the following information):

  • OS: debian
  • Browser chrome
  • Version 92.0.4515.70

Additional context im using jspanel in a webmap with leaflet jquerey bootstrap and slick grids as well as a bunch of other stuff.

syonfox avatar Sep 27 '21 07:09 syonfox

Hi there, So far nobody reported an issue with option resizeit in combination with the aspectRatio setting which is off by default anyhow unless you press either the Alt, Ctrl or Shift key when resizing starts. Since you use a bunch of other scripts as well ... could it be that some other tool includes a resizing feature with an aspect ratio setting?

Flyer53 avatar Sep 27 '21 14:09 Flyer53

Hi I just want to note that this popped up again in another project but still unable to determine whats causing it to happen without using ctrl resizes. but the result is similar to this and the root cause may be the cleanup event not being fired after some weird user action.

I messed around with it a bit and may have found some clues.

https://user-images.githubusercontent.com/9345677/173699533-f9ed39b6-fbde-41b1-91b8-78cac642eb7c.mp4

syonfox avatar Jun 14 '22 22:06 syonfox

Hi, I'm facing the same issue, great explanation by @syonfox.

Is it possible to disable modifier keys at all?

Moltenship avatar Sep 20 '23 10:09 Moltenship

@Moltenship Sorry, currently there is no option to disable the modifier keys.

Flyer53 avatar Sep 21 '23 06:09 Flyer53

I don't think it is necessarily an issue with modifier keys but rather with the mouseup not triggers when it happens quickly outside the window Maybe if we listen for both window.losefocuse and window.pointerup we can ensure that the resize operation is stopped correctly

https://github.com/Flyer53/jsPanel4/assets/9345677/8c671ef3-e446-4892-9ad3-dcfd256cf632

syonfox avatar Sep 21 '23 08:09 syonfox

@syonfox @Moltenship Via the link below you can download a modified jsPanel version where the resizeit modifier keys can be disabled by adding a parameter modifierKeys: false to the resizeit options:

jsPanel.create({
    resizeit: {
        aspectRatio: 'content',
        modifierKeys: false
    }
});

The setting of resizeit.aspectRatio is still working, only the modifier keys are disabled.

https://alpha.jspanel.de/downloads/jspanel-4.16.1-test.zip

Please let me know whether you still can reproduce the issue using the modified js file, thanks.

PS: Although I can't say for sure I don't think the modifier keys are the problem since they do no more than dynamically setting resizeit.aspectRatio to the required value if pressed.

Flyer53 avatar Sep 21 '23 13:09 Flyer53

@Flyer53 Awesome, thanks!

Moltenship avatar Sep 21 '23 14:09 Moltenship

I agre, will take a look. watching the videio again I see that its global since switching between pages in the website the loc bug presisted.

(24s bug present window closed then later new window created and bug still there)

therfore it is somthing in global state no a panel instance

syonfox avatar Sep 21 '23 21:09 syonfox