mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Also reset cursor on text selection
This commit is contained in:
parent
f875abe6b0
commit
656cdd1686
1 changed files with 6 additions and 1 deletions
|
@ -692,6 +692,10 @@ function clearSelection() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetCursor() {
|
||||||
|
document.documentElement.style.cursor = "";
|
||||||
|
}
|
||||||
|
|
||||||
function deleteSelectedElements() {
|
function deleteSelectedElements() {
|
||||||
for (let i = elements.length - 1; i >= 0; --i) {
|
for (let i = elements.length - 1; i >= 0; --i) {
|
||||||
if (elements[i].isSelected) {
|
if (elements[i].isSelected) {
|
||||||
|
@ -1240,6 +1244,7 @@ class App extends React.Component<{}, AppState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTextElement(element)) {
|
if (isTextElement(element)) {
|
||||||
|
resetCursor();
|
||||||
const text = prompt("What text do you want?");
|
const text = prompt("What text do you want?");
|
||||||
if (text === null) {
|
if (text === null) {
|
||||||
return;
|
return;
|
||||||
|
@ -1401,7 +1406,7 @@ class App extends React.Component<{}, AppState> {
|
||||||
window.removeEventListener("mousemove", onMouseMove);
|
window.removeEventListener("mousemove", onMouseMove);
|
||||||
window.removeEventListener("mouseup", onMouseUp);
|
window.removeEventListener("mouseup", onMouseUp);
|
||||||
|
|
||||||
document.documentElement.style.cursor = "";
|
resetCursor();
|
||||||
|
|
||||||
// if no element is clicked, clear the selection and redraw
|
// if no element is clicked, clear the selection and redraw
|
||||||
if (draggingElement === null) {
|
if (draggingElement === null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue