From 57d459f78fa5eee605f572b41464754361df5cf4 Mon Sep 17 00:00:00 2001
From: Arnelle Balane
Date: Fri, 23 Oct 2020 02:00:58 +0800
Subject: [PATCH] Position error tooltip below form field on narrow screen
sizes
---
components/forms/AccountEditForm.js | 12 ++++++++----
components/forms/ChangePasswordForm.js | 18 ++++++++++++------
components/forms/DeleteForm.js | 6 ++++--
components/forms/LoginForm.js | 12 ++++++++----
components/forms/WebsiteEditForm.js | 12 ++++++++----
components/layout/FormLayout.module.css | 20 ++++++++++++++++++--
6 files changed, 58 insertions(+), 22 deletions(-)
diff --git a/components/forms/AccountEditForm.js b/components/forms/AccountEditForm.js
index 63949f00..cc000cf7 100644
--- a/components/forms/AccountEditForm.js
+++ b/components/forms/AccountEditForm.js
@@ -58,15 +58,19 @@ export default function AccountEditForm({ values, onSave, onClose }) {
-
-
+
+
+
+
-
-
+
+
+
+
-
-
+
+
+
+
-
-
+
+
+
+
-
-
+
+
+
+
diff --git a/components/forms/WebsiteEditForm.js b/components/forms/WebsiteEditForm.js
index dc87999e..7be89f79 100644
--- a/components/forms/WebsiteEditForm.js
+++ b/components/forms/WebsiteEditForm.js
@@ -63,15 +63,19 @@ export default function WebsiteEditForm({ values, onSave, onClose }) {
-
-
+
+
+
+
-
-
+
+
+
+
diff --git a/components/layout/FormLayout.module.css b/components/layout/FormLayout.module.css
index 90e1b8c2..1ae393bb 100644
--- a/components/layout/FormLayout.module.css
+++ b/components/layout/FormLayout.module.css
@@ -17,6 +17,10 @@
line-height: 1.8;
}
+.row > div {
+ position: relative;
+}
+
.buttons {
display: flex;
justify-content: center;
@@ -33,9 +37,9 @@
justify-content: center;
align-items: center;
top: 0;
- left: 100%;
+ left: calc(100% + 16px);
bottom: 0;
- margin-left: 16px;
+ z-index: 1;
}
.msg {
@@ -68,3 +72,15 @@
color: var(--gray50);
background: var(--gray800);
}
+
+@media only screen and (max-width: 576px) {
+ .error {
+ align-items: flex-start;
+ top: calc(100% + 7px);
+ left: 0;
+ }
+
+ .error:after {
+ left: 10px;
+ }
+}