Touch selection handle

This commit is contained in:
Akil 2025-06-28 01:11:25 +03:00
parent ce20960d77
commit f08592e0f8

View File

@ -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 }));
}}