Forcing width when resizing
See original GitHub issueHi!
I looked over similar questions but none of the answers work for me, so. My problem is simple: I want to enforce specific width in @resizing event. The point is for the object being resized to be constrained by its parent, but setting :parent
prop doesn’t work for me. Maybe because the parent is a table cell, so my resizable blocks appear somewhere else but not in cells when I set parent restriction. But anyway, I also support dragging between cells, so restricting it to parent won’t work for me.
So I wanted to implement the constraint manually, but changing :width
in @resizing
event doesn’t do anything. Could you give me some advice on how to change object’s width so that when user is resizing it, the width won’t go over the specific value (will be forced to stay at some max value that is dynamically calculated).
Thanks!
P.S. Setting maxwidth won’t do as well because my object may be placed for example in a middle of a cell. So then user would resize to the right and maxwidth will go over the cell’s border.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Please specify this point in the documentation, I spent an hour before I found this thread.
Hi!
First of all, thank you for reporting the issue with this level of details. Much appreciated!
w
andh
are reactive props, but they are disabled during dragging or resizing because otherwise they would interfere with the internals of the component. I know that this is not the best idea and often it causes confusion, but I’m afraid that solving this problem would require a huge rewrite of the component.Back to your problem: there’s no way right now to force a specific width during resizing or dragging, but you can use the
resizestop
anddragstop
events to revert the size of the component to the desired values.