linguabot commited on
Commit
e1246f7
·
verified ·
1 Parent(s): f71933e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/components/Refinity.tsx +24 -1
client/src/components/Refinity.tsx CHANGED
@@ -854,6 +854,28 @@ const EditorPane: React.FC<{ source: string; initialTranslation: string; onBack:
854
  setTextareaHeight(`${height}px`);
855
  }
856
  }, [source]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
857
 
858
  const save = async ()=>{
859
  setSaving(true);
@@ -924,8 +946,9 @@ const EditorPane: React.FC<{ source: string; initialTranslation: string; onBack:
924
  onChange={(e)=>setText(e.target.value)}
925
  className="relative z-10 w-full px-4 py-3 border border-ui-border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white"
926
  style={{
927
- minHeight: textareaHeight,
928
  height: textareaHeight,
 
929
  resize: 'none',
930
  overflowY: 'auto'
931
  }}
 
854
  setTextareaHeight(`${height}px`);
855
  }
856
  }, [source]);
857
+ // Re-measure when fullscreen toggles (layout changes)
858
+ React.useEffect(() => {
859
+ const measure = () => {
860
+ if (sourceRef.current) {
861
+ const h = sourceRef.current.offsetHeight;
862
+ setTextareaHeight(`${h}px`);
863
+ }
864
+ };
865
+ // double rAF to wait for layout stabilization
866
+ requestAnimationFrame(() => requestAnimationFrame(measure));
867
+ }, [isFullscreen]);
868
+ // Re-measure on window resize
869
+ React.useEffect(() => {
870
+ const onResize = () => {
871
+ if (sourceRef.current) {
872
+ const h = sourceRef.current.offsetHeight;
873
+ setTextareaHeight(`${h}px`);
874
+ }
875
+ };
876
+ window.addEventListener('resize', onResize);
877
+ return () => window.removeEventListener('resize', onResize);
878
+ }, []);
879
 
880
  const save = async ()=>{
881
  setSaving(true);
 
946
  onChange={(e)=>setText(e.target.value)}
947
  className="relative z-10 w-full px-4 py-3 border border-ui-border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white"
948
  style={{
949
+ minHeight: textareaHeight,
950
  height: textareaHeight,
951
+ maxHeight: textareaHeight,
952
  resize: 'none',
953
  overflowY: 'auto'
954
  }}