Fix Bug №48073

This commit is contained in:
ShimaginAndrey 2021-04-21 12:44:29 +03:00
parent 87fb7fe1bd
commit 9b16457b17
2 changed files with 15 additions and 2 deletions

View file

@ -72,6 +72,7 @@ const PageLinkTo = props => {
const PageLink = props => { const PageLink = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true}); const _t = t('View.Add', {returnObjects: true});
const regx = /["https://"]/g
const [typeLink, setTypeLink] = useState(1); const [typeLink, setTypeLink] = useState(1);
const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation; const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation;
@ -114,7 +115,13 @@ const PageLink = props => {
type="text" type="text"
placeholder={_t.textLink} placeholder={_t.textLink}
value={link} value={link}
onChange={(event) => {setLink(event.target.value)}} onChange={(event) => {
if (link.includes('https://')) {
setDisplay(link)
}
setLink(event.target.value)
setDisplay(event.target.value)
}}
/> : /> :
<ListItem link={'/add-link-to/'} title={_t.textLinkTo} after={displayTo} routeProps={{ <ListItem link={'/add-link-to/'} title={_t.textLinkTo} after={displayTo} routeProps={{
changeTo: changeTo, changeTo: changeTo,

View file

@ -87,7 +87,13 @@ const AddLinkView = props => {
type="text" type="text"
placeholder={_t.textLink} placeholder={_t.textLink}
value={link} value={link}
onChange={(event) => {setLink(event.target.value)}} onChange={(event) => {
if (link.includes('https://')) {
setDisplayText(link)
}
setLink(event.target.value)
setDisplayText(event.target.value)
}}
className={isIos ? 'list-input-right' : ''} className={isIos ? 'list-input-right' : ''}
/> />
} }