From a26d439c494ad24dbb857196f4430e657838bd8e Mon Sep 17 00:00:00 2001
From: lisalupi <106706307+lisalupi@users.noreply.github.com>
Date: Tue, 8 Oct 2024 10:48:46 +0200
Subject: [PATCH] fix(SelectInputV2): auto scroll (#4282)
* fix: selectinputv2 auto scroll
* fix: remove useEffect
* fix: tests
---
.changeset/little-suits-drive.md | 5 +++
.../__snapshots__/index.test.tsx.snap | 1 +
.../__snapshots__/index.test.tsx.snap | 1 +
.../components/Modal/components/Dialog.tsx | 1 +
.../src/components/SelectInputV2/Dropdown.tsx | 30 +++++++++++++-
.../__stories__/Modal.stories.tsx | 41 +++++++++++++++++++
.../__stories__/index.stories.tsx | 1 +
.../ui/src/components/SelectInputV2/index.tsx | 1 +
.../__snapshots__/index.test.tsx.snap | 1 +
9 files changed, 80 insertions(+), 2 deletions(-)
create mode 100644 .changeset/little-suits-drive.md
create mode 100644 packages/ui/src/components/SelectInputV2/__stories__/Modal.stories.tsx
diff --git a/.changeset/little-suits-drive.md b/.changeset/little-suits-drive.md
new file mode 100644
index 0000000000..6b7a69d021
--- /dev/null
+++ b/.changeset/little-suits-drive.md
@@ -0,0 +1,5 @@
+---
+"@ultraviolet/ui": patch
+---
+
+``: auto scroll when the component is at the bottom of the page
diff --git a/packages/form/src/components/SelectInputFieldV2/__tests__/__snapshots__/index.test.tsx.snap b/packages/form/src/components/SelectInputFieldV2/__tests__/__snapshots__/index.test.tsx.snap
index 8554ddf92e..db2f4bbccc 100644
--- a/packages/form/src/components/SelectInputFieldV2/__tests__/__snapshots__/index.test.tsx.snap
+++ b/packages/form/src/components/SelectInputFieldV2/__tests__/__snapshots__/index.test.tsx.snap
@@ -312,6 +312,7 @@ exports[`SelectInputField > should display right value on grouped options 1`] =
color: #3f4250;
box-shadow: 0px 4px 8px 0px #22263829,0px 8px 24px 0px #2226383d;
padding: 0;
+ margin-bottom: 80px;
}
.emotion-20[data-animated="true"] {
diff --git a/packages/ui/src/components/Modal/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Modal/__tests__/__snapshots__/index.test.tsx.snap
index 9e6cbf8c33..1511069b21 100644
--- a/packages/ui/src/components/Modal/__tests__/__snapshots__/index.test.tsx.snap
+++ b/packages/ui/src/components/Modal/__tests__/__snapshots__/index.test.tsx.snap
@@ -556,6 +556,7 @@ exports[`Modal > renders with disclosure and onClose 1`] = `
data-open="true"
data-testid="test-backdrop"
data-visible="true"
+ id="backdrop-modal"
>