-
Notifications
You must be signed in to change notification settings - Fork 107
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
Resize form fields #593
Resize form fields #593
Conversation
895e55e
to
965fb90
Compare
965fb90
to
564b3c2
Compare
564b3c2
to
b7d1a78
Compare
b7d1a78
to
2512684
Compare
2512684
to
13fb581
Compare
13fb581
to
1b3cf53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some minor issues (as mentioned in Slack), but they aren't related to the resize handles.
Really like the smooth handling of the resize handles!
* | ||
* @return {Function} drag start callback function | ||
*/ | ||
export function createDragger(fn, dragPreview) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference: I had a look at some existing resizable component solutions (e.g., https://github.com/react-grid-layout/react-resizable, https://www.npmjs.com/package/preact-moveable), but none of them gave enough flexibility to achieve what we wanted; especially due to the fact we resize in columns, not pixels.
I decided to re-use proven utilities from bpmn-io to implement the behaviors.
@pinussilvestrus for the handle height, can't we add a max-height of like |
7b47150
to
87148e2
Compare
Oh yeah, damn right 😅 I thought it too complicated. Just pushed it, demo should be up in a few minutes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinussilvestrus 2 things I found
- Maybe we should disable the handle if an element is the first column of the row?
2023-04-14.15-15-02.mp4
- Should we maybe prevent user from breaking into a new row?
2023-04-14.15-15-53.mp4
Not sure about this one, it could be confusing for users if that's missing for just this case. wdyt @RomanKostka?
That should not happen, but I also see this behavior outside of resizing, also cf. to the findings Christian made with auto columns. I didn't see it with resizing yet. Can you maybe share your setup? So the columns of each form field and maybe whether you are on a smaller screen? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great man 👍, just a few small behavior things that might be worth looking at, but otherwise what a contribution.
05afdd6
to
59d464d
Compare
To consider as an improvement on top: #604. It depends on whether we introduce single step columns or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good (just made some minor comments), let's just wait to hear Roman's comment about the points I raised earlier
We force top-down layouts on these screens.
59d464d
to
dffbe06
Compare
I would propose to leave it as it is and keep the handles. Feels natural at least for me - this is something we can investigate further when we talk to some users One other thing to mention to keep track of it: |
It's a thing I spent an eye for quite a while now. The thing is that Carbon calculates the breakpoints on the screen basis, not container basis, as container based media queries (CSS) are not well supported across browsers. So it doesn't matter whether you are in a single form context, or have setups like the playground were a lot is going on. Increasing the breakpoint might solve it for quite some cases, but probably not every. Definitely a thing we should keep tracking, and act on once we need 👍 |
Closes #566
Closes #572
Closes #605
Demo: https://demo-566-form-field-resize--camunda-form-playground.netlify.app/