Skip to content

Commit

Permalink
fix: popup width growth on click
Browse files Browse the repository at this point in the history
fix: #902
fix: #870
  • Loading branch information
windingwind committed Aug 7, 2024
1 parent 614b12d commit abb1ac3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ export function buildReaderPopup(
const textarea = popup.querySelector(
`#${makeId("text")}`,
) as HTMLTextAreaElement;
if (popup.scrollWidth > textarea.offsetWidth + 10) {
textarea.style.width = `${popup.scrollWidth - 10}px`;
const outerWidth = 10;
if (popup.scrollWidth > textarea.offsetWidth + outerWidth) {
textarea.style.width = `${popup.scrollWidth - outerWidth}px`;
}
},
},
Expand Down

0 comments on commit abb1ac3

Please sign in to comment.