From 88a2406080e098293f08c06243390545fa9e35e3 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Mon, 23 Aug 2021 13:13:47 +0300 Subject: [PATCH] [DE PE SSE mobile] Fix Bug 52109 --- apps/documenteditor/mobile/src/view/add/AddLink.jsx | 6 +++--- apps/presentationeditor/mobile/src/view/add/AddLink.jsx | 4 ++-- apps/spreadsheeteditor/mobile/src/view/add/AddLink.jsx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/mobile/src/view/add/AddLink.jsx b/apps/documenteditor/mobile/src/view/add/AddLink.jsx index 1dade24c8..f2bc4712b 100644 --- a/apps/documenteditor/mobile/src/view/add/AddLink.jsx +++ b/apps/documenteditor/mobile/src/view/add/AddLink.jsx @@ -13,8 +13,8 @@ const PageLink = props => { const [stateLink, setLink] = useState(''); const [stateDisplay, setDisplay] = useState(display); const [stateTip, setTip] = useState(''); - const [stateAutoUpdate, setAutoUpdate] = useState(true); - + const [stateAutoUpdate, setAutoUpdate] = useState(!stateDisplay ? true : false); + return ( {!props.noNavbar && } @@ -26,7 +26,7 @@ const PageLink = props => { value={stateLink} onChange={(event) => { setLink(event.target.value); - if((!stateDisplay || stateDisplay === stateLink) && stateAutoUpdate) setDisplay(event.target.value); + if(stateAutoUpdate) setDisplay(event.target.value); }} > { const display = props.getTextDisplay(); const displayDisabled = display !== false && display === null; const [stateDisplay, setDisplay] = useState(display !== false ? ((display !== null) ? display : _t.textDefault) : ""); - const [stateAutoUpdate, setAutoUpdate] = useState(true); + const [stateAutoUpdate, setAutoUpdate] = useState(!stateDisplay ? true : false); const [screenTip, setScreenTip] = useState(''); return ( @@ -117,7 +117,7 @@ const PageLink = props => { value={link} onChange={(event) => { setLink(event.target.value); - if((!stateDisplay || stateDisplay === link) && stateAutoUpdate) setDisplay(event.target.value); + if(stateAutoUpdate) setDisplay(event.target.value); }} /> : { displayText = displayDisabled ? _t.textSelectedRange : displayText; const [stateDisplayText, setDisplayText] = useState(displayText); - const [stateAutoUpdate, setAutoUpdate] = useState(true); + const [stateAutoUpdate, setAutoUpdate] = useState(!stateDisplayText ? true : false); const [screenTip, setScreenTip] = useState(''); const activeSheet = props.activeSheet; @@ -90,7 +90,7 @@ const AddLinkView = props => { value={link} onChange={(event) => { setLink(event.target.value); - if((!stateDisplayText || stateDisplayText === link) && stateAutoUpdate && !displayDisabled) setDisplayText(event.target.value); + if(stateAutoUpdate && !displayDisabled) setDisplayText(event.target.value); }} className={isIos ? 'list-input-right' : ''} />