fix: drop down not clickable

fix #73
pull/91/head
sualko 2020-09-24 09:53:47 +02:00
parent 43aee27a47
commit a81d97a6e5
1 changed files with 13 additions and 4 deletions

View File

@ -48,9 +48,13 @@ const ShareSelection: React.FC<Props> = (props) => {
}, []); }, []);
useEffect(() => { useEffect(() => {
setTimeout(() => setShowSearchResults(hasFocus), 100); setShowSearchResults(hasFocus);
}, [hasFocus]); }, [hasFocus]);
function preventOnBlurEvent(ev: React.MouseEvent) {
ev.preventDefault();
}
async function selectShare(share: ShareWithOption) { async function selectShare(share: ShareWithOption) {
props.selectShare(share); props.selectShare(share);
@ -65,9 +69,14 @@ const ShareSelection: React.FC<Props> = (props) => {
] : []; ] : [];
const renderOption = (option: ShareWithOption) => { const renderOption = (option: ShareWithOption) => {
return (<li key={option.value.shareWith} className="suggestion" onClick={() => selectShare(option)}> return (
{option.label}{option.value.shareType === ShareType.Group ? ` (${t('bbb', 'Group')})` : ''} <li
</li>); key={option.value.shareWith}
className="suggestion"
onMouseDown={preventOnBlurEvent}
onClick={() => selectShare(option)}>
{option.label}{option.value.shareType === ShareType.Group ? ` (${t('bbb', 'Group')})` : ''}
</li>);
}; };
return ( return (