Skip to content

Commit

Permalink
[@mantine/hooks] use-move: Fix content on the page being selected whe…
Browse files Browse the repository at this point in the history
…n cursor moves over the target element (#3069)
  • Loading branch information
rtivital committed Nov 28, 2022
1 parent 7e4e98a commit 10a1af2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/mantine-hooks/src/use-move/use-move.ts
Expand Up @@ -88,6 +88,7 @@ export function useMove<T extends HTMLElement = HTMLDivElement>(

const onMouseDown = (event: MouseEvent) => {
startScrubbing();
event.preventDefault();
onMouseMove(event);
};

Expand Down
8 changes: 5 additions & 3 deletions src/mantine-tiptap/src/RichTextEditor.story.tsx
Expand Up @@ -28,6 +28,10 @@ lowlight.registerLanguage('ts', ts);

export default { title: 'TipTap' };

const lorem =
'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Veritatis necessitatibus, impedit tempora, provident voluptate aliquid eos eveniet expedita iusto mollitia accusamus illum sunt fugiat quisquam tempore molestias nulla voluptatem cumque!';
const htmlContent = Array.from({ length: 10 }).fill(`<p>${lorem}</p>`).join('');

function BasicEditor({
editorProps,
content,
Expand All @@ -51,7 +55,7 @@ function BasicEditor({
types: ['heading', 'paragraph'],
}),
],
content: content || '<p>Hello World!</p>',
content: content || htmlContent,
});

return (
Expand Down Expand Up @@ -219,8 +223,6 @@ export function CodeHighlight() {
);
}

const lorem =
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum dicta praesentium perferendis tenetur provident ratione iste, at quo ea enim excepturi, delectus alias nesciunt dolorem. Modi doloremque sed facere nam.';
const largeContent = Array(20)
.fill(0)
.map(() => `<p>${lorem}</p>`)
Expand Down

0 comments on commit 10a1af2

Please sign in to comment.