-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Cursors for panel resizing #28
Comments
Hi :), thanks a lot for your attention, you have understood very well the problem! (having I'm trying to avoid The transparent But i'm agree, having some cursors will be great :D |
I tried out the pseudo element solution I mentioned, and it works: https://jsfiddle.net/1j01/2d267n4z/ I'd actually recommend it, it's pretty simple: .resize-handle:active::after {
content: "";
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
} Although z-indexes might be a problem, in which case you might have to go with a |
Well thank you a lot :) I will have to add these changes in this folder https://github.com/gridsound/gs-ui-components/tree/master/gsuiPanels. I don't understand this comment of your jsfiddle
|
I know, right? 😃
By default the browser* will give you mousemove and mouseup events outside the window (or iframe) for the duration of a mouse gesture, but if you call *unless that browser is IE. But IE has And by "landing at max", I mean dragging a resizer maximally towards the edge of the window, generally minimizing a pane. Your UI is actually rather resilient to this problem by simply having large minimum pane sizes / distances from the edges of the window: Windows actually has this problem worse, with the taskbar - because even though they have a minimum width, they inexplicably don't respond to mouse movement within that minimum range: 😖 ...I need to switch operating systems. |
Hi @1j01, to be able to catch the |
Thanks again for your help, your animated screeshots and jsfiddle are very helpful! |
CSS cursors should make the app feel more solid, making the act of resizing panes more familiar.
MDN docs with
cursor
value previewsI'd go with
ew-resize
(horizontal) andns-resize
(vertical).There's also
col-resize
androw-resize
, but they don't look as good on Windows, and it sounds like semantically they're intended for tables, like resizing column headers.Oh yeah, and if you just apply the cursor to the resizer element, it'll have a problem where it'll flicker between cursors as the resizer element catches up with the cursor, and lags behind, alternately.
So what you can do is add a class to the body on
mousedown
and remove it onmouseup
.with e.g.
.horizontal-resize * { pointer: ew-resize !important }
Or another option, that I'm just thinking of now, might be to add a pseudo element to the resizer on
:active
that'sposition: absolute
and fills the whole page. That'd be a fun way to do it!But um, the other way is probably more practical.
setCapture
would be helpful if it had decent browser support.The text was updated successfully, but these errors were encountered: