Skip to content

Commit 4299d31

Browse files
Moerlin1337Merlin
and
Merlin
authored
fix: only show dropdown scrollbar if it is scrollable (#86)
* feat: only show dropdown scrollbar if it is scrollable * chore: remove unnecessary overflow-hidden class from dropdown --------- Co-authored-by: Merlin <[email protected]>
1 parent c95aa3b commit 4299d31

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ These are the default Tailwind classes used for styling the component.
8585
placeholder: 'flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 text-gray-400',
8686
clear: 'pr-3.5 relative z-10 opacity-40 transition duration-300 flex-shrink-0 flex-grow-0 flex hover:opacity-80',
8787
clearIcon: 'text-lg font-bold text-center pl-3',
88-
dropdown: 'max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-scroll z-50 bg-white flex flex-col rounded-b',
88+
dropdown: 'max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-auto z-50 bg-white flex flex-col rounded-b',
8989
dropdownHidden: 'hidden',
9090
options: 'flex flex-col p-0 m-0 list-none',
9191
option: 'flex items-center justify-start box-border text-left cursor-pointer text-base leading-snug py-2 px-3 hover:text-gray-800 hover:bg-gray-100',

src/style/tailwind.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
.multiselect-dropdown {
19-
@apply max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-scroll z-50 bg-white flex flex-col rounded-b;
19+
@apply max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-auto z-50 bg-white flex flex-col rounded-b;
2020
}
2121

2222
.multiselect-dropdown.is-hidden {

src/utils/defaultTheme.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const defaultTheme = {
77
placeholder: 'flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 text-gray-400',
88
clear: 'pr-3.5 relative z-10 opacity-40 transition duration-300 flex-shrink-0 flex-grow-0 flex hover:opacity-80',
99
clearIcon: 'text-lg font-bold text-center pl-3',
10-
dropdown: 'max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-scroll z-50 bg-white flex flex-col rounded-b',
10+
dropdown: 'max-h-60 absolute -left-px -right-px bottom-0 transform translate-y-full border border-gray-300 -mt-px overflow-y-auto z-50 bg-white flex flex-col rounded-b',
1111
dropdownHidden: 'hidden',
1212
options: 'flex flex-col p-0 m-0 list-none',
1313
option: 'flex items-center justify-start box-border text-left cursor-pointer text-base leading-snug py-2 px-3 hover:text-gray-800 hover:bg-gray-100',
@@ -28,7 +28,7 @@ export const baseStyle = {
2828
placeholder: 'flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5',
2929
clear: 'pr-3.5 relative z-10 opacity-40 transition duration-300 flex-shrink-0 flex-grow-0 flex hover:opacity-80',
3030
clearIcon: 'text-lg font-bold text-center pl-3',
31-
dropdown: 'absolute -left-px -right-px bottom-0 transform translate-y-full border -mt-px overflow-y-scroll z-50 flex flex-col rounded-b',
31+
dropdown: 'absolute -left-px -right-px bottom-0 transform translate-y-full border -mt-px overflow-y-auto z-50 flex flex-col rounded-b',
3232
dropdownHidden: 'hidden',
3333
options: 'flex flex-col list-none',
3434
option: 'flex items-center justify-start box-border text-left cursor-pointer text-base leading-snug',

0 commit comments

Comments
 (0)