|
@@ -116,6 +116,13 @@ const PollCreate = (props: AbstractProps) => {
|
116
|
116
|
|
117
|
117
|
const [ grabbing, setGrabbing ] = useState(null);
|
118
|
118
|
|
|
119
|
+ const interchangeHeights = (i, j) => {
|
|
120
|
+ const h = answerInputs.current[i].scrollHeight;
|
|
121
|
+
|
|
122
|
+ answerInputs.current[i].style.height = `${answerInputs.current[j].scrollHeight}px`;
|
|
123
|
+ answerInputs.current[j].style.height = `${h}px`;
|
|
124
|
+ };
|
|
125
|
+
|
119
|
126
|
const onGrab = useCallback((i, ev) => {
|
120
|
127
|
if (ev.button !== 0) {
|
121
|
128
|
return;
|
|
@@ -131,6 +138,7 @@ const PollCreate = (props: AbstractProps) => {
|
131
|
138
|
});
|
132
|
139
|
const onMouseOver = useCallback(i => {
|
133
|
140
|
if (grabbing !== null && grabbing !== i) {
|
|
141
|
+ interchangeHeights(i, grabbing);
|
134
|
142
|
moveAnswer(grabbing, i);
|
135
|
143
|
setGrabbing(i);
|
136
|
144
|
}
|