linguabot commited on
Commit
d8c2add
·
verified ·
1 Parent(s): bee59bb

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/pages/TutorialTasks.tsx +23 -0
client/src/pages/TutorialTasks.tsx CHANGED
@@ -179,6 +179,25 @@ const TutorialTasks: React.FC = () => {
179
  try { console.log('[Trace] unlockGridHeight', { id }); } catch {}
180
  };
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  // (removed) ResizeObserver scroll compensator
183
 
184
  const withPreservedCardOffset = (taskId: string, fn: () => void) => {
@@ -693,6 +712,7 @@ const TutorialTasks: React.FC = () => {
693
  lockListHeight();
694
  lockCardHeightById(taskId);
695
  lockGridHeightById(taskId);
 
696
  withPreservedCardOffset(taskId, () => {
697
  setMutatingTaskId(taskId);
698
  setExpandedSections(prev => ({
@@ -954,6 +974,7 @@ const TutorialTasks: React.FC = () => {
954
  unlockListHeight();
955
  unlockCardHeightById(taskId);
956
  unlockGridHeightById(taskId);
 
957
  pendingUnlocksRef.current.delete(taskId);
958
  if (isSafari) { unfreezeScroll(); }
959
  disableCompensationRef.current.delete(taskId);
@@ -988,6 +1009,7 @@ const TutorialTasks: React.FC = () => {
988
  unlockListHeight();
989
  unlockCardHeightById(taskId);
990
  unlockGridHeightById(taskId);
 
991
  pendingUnlocksRef.current.delete(taskId);
992
  if (isSafari) { unfreezeScroll(); }
993
  disableCompensationRef.current.delete(taskId);
@@ -1012,6 +1034,7 @@ const TutorialTasks: React.FC = () => {
1012
  unlockListHeight();
1013
  unlockCardHeightById(taskId);
1014
  unlockGridHeightById(taskId);
 
1015
  if (isSafari) { unfreezeScroll(); }
1016
  };
1017
  if (isSafari) {
 
179
  try { console.log('[Trace] unlockGridHeight', { id }); } catch {}
180
  };
181
 
182
+ // Container height lock to stabilize Safari during submit/delete
183
+ const lockContainerHeightById = (id: string) => {
184
+ const el = submissionsContainerRefs.current[id];
185
+ if (!el) return;
186
+ const h = el.getBoundingClientRect().height || lastPreHeightRef.current[id] || 0;
187
+ el.style.minHeight = `${h}px`;
188
+ el.style.height = `${h}px`;
189
+ el.style.overflow = 'hidden';
190
+ try { console.log('[Trace] lockContainerHeight', { id, h }); } catch {}
191
+ };
192
+ const unlockContainerHeightById = (id: string) => {
193
+ const el = submissionsContainerRefs.current[id];
194
+ if (!el) return;
195
+ el.style.overflow = '';
196
+ el.style.height = '';
197
+ el.style.minHeight = '';
198
+ try { console.log('[Trace] unlockContainerHeight', { id }); } catch {}
199
+ };
200
+
201
  // (removed) ResizeObserver scroll compensator
202
 
203
  const withPreservedCardOffset = (taskId: string, fn: () => void) => {
 
712
  lockListHeight();
713
  lockCardHeightById(taskId);
714
  lockGridHeightById(taskId);
715
+ lockContainerHeightById(taskId);
716
  withPreservedCardOffset(taskId, () => {
717
  setMutatingTaskId(taskId);
718
  setExpandedSections(prev => ({
 
974
  unlockListHeight();
975
  unlockCardHeightById(taskId);
976
  unlockGridHeightById(taskId);
977
+ unlockContainerHeightById(taskId);
978
  pendingUnlocksRef.current.delete(taskId);
979
  if (isSafari) { unfreezeScroll(); }
980
  disableCompensationRef.current.delete(taskId);
 
1009
  unlockListHeight();
1010
  unlockCardHeightById(taskId);
1011
  unlockGridHeightById(taskId);
1012
+ unlockContainerHeightById(taskId);
1013
  pendingUnlocksRef.current.delete(taskId);
1014
  if (isSafari) { unfreezeScroll(); }
1015
  disableCompensationRef.current.delete(taskId);
 
1034
  unlockListHeight();
1035
  unlockCardHeightById(taskId);
1036
  unlockGridHeightById(taskId);
1037
+ unlockContainerHeightById(taskId);
1038
  if (isSafari) { unfreezeScroll(); }
1039
  };
1040
  if (isSafari) {