Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetDealer committed Feb 9, 2024
1 parent d7e9af3 commit 88ba8e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/EditText/EditText.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export default class EditText extends HTMLElement {
this.#children.popup.addEventListener('keydown', this.#onKeydown.bind(this));
this.#children.input.onInput(this.#onInput.bind(this));
this.addEventListener("cancel", this.#onEscape.bind(this));
this.querySelector(".popup-content").addEventListener("click", (event) => {
event.stopPropagation();
});
// this.querySelector(".popup-content").addEventListener("click", (event) => {
// event.stopPropagation();
// });
}

#showPopup() {
Expand Down Expand Up @@ -142,7 +142,8 @@ export default class EditText extends HTMLElement {
let {top, left} = this.getBoundingClientRect();
this.#children.popup.style.top = top + window.scrollY + "px";
this.#children.popup.style.left = left + window.scrollX + "px";
this.#children.popup.style['max-width'] = this.offsetWidth + 56 + "px";
console.log(this.offsetWidth)
this.#children.popup.style['max-width'] = this.offsetWidth + 16 + "px";
}

#isNumberType() {
Expand Down Expand Up @@ -192,7 +193,7 @@ export default class EditText extends HTMLElement {
patternAttr = `pattern="${this.getAttribute("pattern")}"`
return `<span class="edit-text__text"></span>
<dialog class="edit-text__popup" tabindex="9">
<section class="popup-content">
<text-input
class="text-input--with-right-icon"
label=""
Expand All @@ -206,7 +207,7 @@ export default class EditText extends HTMLElement {
${patternAttr}
type="${typeAttr}"
></text-input>
</section>
</dialog>`;
}

Expand Down
1 change: 1 addition & 0 deletions src/EditText/EditText.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
edit-text {
display: inline-block;
max-width: 100%;
}

.edit-text__popup {
Expand Down

0 comments on commit 88ba8e2

Please sign in to comment.