Touch selection handle
This commit is contained in:
parent
ce20960d77
commit
f08592e0f8
@ -12,6 +12,9 @@ const SelectableParagraph = ({ content, surahNo, verseNo, onDetailClick }) => {
|
||||
});
|
||||
|
||||
const handleTextSelect = (e) => {
|
||||
// e.preventDefault();
|
||||
// e.stopPropagation();
|
||||
|
||||
const selection = window.getSelection();
|
||||
// console.log('selection', selection.toString());
|
||||
if (!selection || selection.toString().trim() === '') {
|
||||
@ -29,7 +32,7 @@ const SelectableParagraph = ({ content, surahNo, verseNo, onDetailClick }) => {
|
||||
y: rect.bottom
|
||||
},
|
||||
visible: true
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@ -92,7 +95,8 @@ const SelectableParagraph = ({ content, surahNo, verseNo, onDetailClick }) => {
|
||||
>
|
||||
<div
|
||||
onMouseUp={handleTextSelect}
|
||||
// style={{ marginBottom: '20px', cursor: 'text' }}
|
||||
onTouchEnd={handleTextSelect}
|
||||
|
||||
onMouseDown={(e) => {
|
||||
setSelection(prev => ({ ...prev, visible: false }));
|
||||
}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user