Created a Resizable HTML table, missing one last thing

I created a Resizable table with event listeners, I used React because I need it in my project (mainly for useRef Hooks). Stackblitz - https://stackblitz.com/edit/react-ts-devbrv?file=useResizableTable.ts Basically when shrinking a column, it checks that the columns' widths are higher than the minimum width, and if not, recursively searches for the next column it can shrink and focuses on it. The only remaining problem is that if I expand a column and shrink multiple columns with it, and then change direction, it expands the wrong column, basically dragging multiple columns instead of the first available one it can expand. e.g. try to expand the Company column until the end, and then shrink it without leaving mousedown, you would imagine that Company will shrink and Contact will expand, but instead it expands Spouse. Would love to get help on the issue and some thoughts on the implementation, and how would you implement it differently Thanks
Gilad Lekner
StackBlitz
Resizeable HTML Table - StackBlitz
Resizeable HTML Table with event listeners
4 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
nanorise
nanoriseOP3y ago
@flicknote thanks for the reply, I wanted to approach this with working with the DOM. your way of thinking is looking very promising, but I wonder if we can get it to work with the current implementation
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
nanorise
nanoriseOP3y ago
I solved it with a flag indicating if the user changed direction mid-resize
Want results from more Discord servers?
Add your server