Skip to content

Commit b6a5a32

Browse files
committed
Fix bug 🐛: Mobile responsiveness #12
1 parent 5e332ec commit b6a5a32

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/Input.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ const Input: React.FC = () => {
9898
}
9999
}
100100

101-
if (buttonRef?.current) {
102-
if (button) {
103-
button.addEventListener("click", focusInput);
104-
}
101+
if (button) {
102+
button.addEventListener("click", focusInput);
105103
}
106104

107105
return () => {
@@ -128,7 +126,11 @@ const Input: React.FC = () => {
128126
if (arrow && div && div.classList.contains("hidden")) {
129127
div.classList.remove("hidden");
130128
div.classList.add("block");
131-
if (window.screen.height - 100 < div.getBoundingClientRect().bottom) {
129+
// window.innerWidth === 767
130+
if (
131+
window.innerWidth > 767 &&
132+
window.screen.height - 100 < div.getBoundingClientRect().bottom
133+
) {
132134
div.classList.add("bottom-full");
133135
div.classList.add("mb-2.5");
134136
div.classList.remove("mt-2.5");

0 commit comments

Comments
 (0)