Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
fix editing (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkd705 authored Jul 17, 2024
1 parent 9eca730 commit ea758b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/mocksi-lite/content/EditMode/decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function decorate(
} = { onSubmit: undefined, onCancel: undefined },
) {
const newSpan = document.createElement("span");
newSpan.style.position = "mw-relative";

This comment has been minimized.

Copy link
@elg0nz

elg0nz Jul 18, 2024

Contributor

great catches!
I might have gone a little trigger-happy with my css selectors 😅

newSpan.style.position = "relative";
newSpan.id = "mocksiSelectedText";
newSpan.appendChild(document.createTextNode(text));
const textArea = injectTextArea(
Expand All @@ -37,7 +37,7 @@ function injectTextArea(
width: width ? "120%" : "150%",
height: "100%",
border: "1px solid red",
position: "mw-absolute",
position: "absolute",
top: "0",
left: "0",
zIndex: "999",
Expand Down
2 changes: 1 addition & 1 deletion apps/mocksi-lite/content/EditMode/highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const highlight = ({
}) => {
const highlightDiv = document.createElement("div");
highlightDiv.className = MOCKSI_HIGHLIGHTER_ID;
highlightDiv.style.position = "mw-absolute";
highlightDiv.style.position = "absolute";
highlightDiv.style.top = `${window.scrollY + y + -2}px`;
highlightDiv.style.left = `${window.scrollX + x + -2}px`;
// 4px more because we're removing 2px each side because of the border
Expand Down

0 comments on commit ea758b8

Please sign in to comment.