From 88ba8e28505a6237401ac458e0ec0c4ee145306b Mon Sep 17 00:00:00 2001 From: Kateryna Tkachenko Date: Fri, 9 Feb 2024 20:02:58 +0100 Subject: [PATCH] wip --- src/EditText/EditText.js | 13 +++++++------ src/EditText/EditText.scss | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/EditText/EditText.js b/src/EditText/EditText.js index 48bbe42..ecccb89 100644 --- a/src/EditText/EditText.js +++ b/src/EditText/EditText.js @@ -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() { @@ -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() { @@ -192,7 +193,7 @@ export default class EditText extends HTMLElement { patternAttr = `pattern="${this.getAttribute("pattern")}"` return ` - + `; } diff --git a/src/EditText/EditText.scss b/src/EditText/EditText.scss index 3bafb33..ee6e188 100644 --- a/src/EditText/EditText.scss +++ b/src/EditText/EditText.scss @@ -1,5 +1,6 @@ edit-text { display: inline-block; + max-width: 100%; } .edit-text__popup {