[DE PE SSE] Fix Bug 48073

This commit is contained in:
ShimaginAndrey 2021-07-15 18:19:32 +03:00
parent 665d985de2
commit 2dce8b8db3
3 changed files with 16 additions and 8 deletions

View file

@ -13,6 +13,8 @@ const PageLink = props => {
const [stateLink, setLink] = useState('');
const [stateDisplay, setDisplay] = useState(display);
const [stateTip, setTip] = useState('');
const [stateAutoUpdate, setAutoUpdate] = useState(true);
return (
<Page>
{!props.noNavbar && <Navbar title={_t.textAddLink} backLink={_t.textBack}></Navbar>}
@ -22,14 +24,16 @@ const PageLink = props => {
type="text"
placeholder={_t.textLink}
value={stateLink}
onChange={(event) => {setLink(event.target.value)}}
onChange={(event) => {setLink(event.target.value);
if(stateAutoUpdate) setDisplay(event.target.value); }}
></ListInput>
<ListInput
label={_t.textDisplay}
type="text"
placeholder={_t.textDisplay}
value={stateDisplay}
onChange={(event) => {setDisplay(event.target.value)}}
onChange={(event) => {setDisplay(event.target.value);
setAutoUpdate(event.target.value == ''); }}
></ListInput>
<ListInput
label={_t.textScreenTip}

View file

@ -99,7 +99,7 @@ const PageLink = props => {
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 [screenTip, setScreenTip] = useState('');
return (
@ -116,7 +116,8 @@ const PageLink = props => {
placeholder={_t.textLink}
value={link}
onChange={(event) => {
setLink(event.target.value)
setLink(event.target.value);
if(stateAutoUpdate) setDisplay(event.target.value);
}}
/> :
<ListItem link={'/add-link-to/'} title={_t.textLinkTo} after={displayTo} routeProps={{
@ -129,7 +130,8 @@ const PageLink = props => {
placeholder={_t.textDisplay}
value={stateDisplay}
disabled={displayDisabled}
onChange={(event) => {setDisplay(event.target.value)}}
onChange={(event) => {setDisplay(event.target.value);
setAutoUpdate(event.target.value == ''); }}
/>
<ListInput label={_t.textScreenTip}
type="text"

View file

@ -62,7 +62,7 @@ const AddLinkView = props => {
const displayDisabled = displayText === 'locked';
displayText = displayDisabled ? _t.textSelectedRange : displayText;
const [stateDisplayText, setDisplayText] = useState(displayText);
const [stateAutoUpdate, setAutoUpdate] = useState(true);
const [screenTip, setScreenTip] = useState('');
const activeSheet = props.activeSheet;
@ -88,7 +88,8 @@ const AddLinkView = props => {
placeholder={_t.textLink}
value={link}
onChange={(event) => {
setLink(event.target.value)
setLink(event.target.value);
if(stateAutoUpdate) setDisplayText(event.target.value);
}}
className={isIos ? 'list-input-right' : ''}
/>
@ -114,7 +115,8 @@ const AddLinkView = props => {
placeholder={_t.textDisplay}
value={stateDisplayText}
disabled={displayDisabled}
onChange={(event) => {setDisplayText(event.target.value)}}
onChange={(event) => {setDisplayText(event.target.value);
setAutoUpdate(event.target.value == ''); }}
className={isIos ? 'list-input-right' : ''}
/>
<ListInput label={_t.textScreenTip}