Skip to content

Commit

Permalink
fix: wrong items reference in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
silviuaavram committed Feb 4, 2023
1 parent 5baf4ba commit f41971e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
20 changes: 14 additions & 6 deletions docs/downshift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function ComboBox() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand All @@ -155,8 +155,12 @@ function ComboBox() {
.filter(
item =>
!inputValue ||
item.title.toLowerCase().includes(inputValue.toLowerCase()) ||
item.author.toLowerCase().includes(inputValue.toLowerCase()),
item.title
.toLowerCase()
.includes(inputValue.toLowerCase()) ||
item.author
.toLowerCase()
.includes(inputValue.toLowerCase()),
)
.map((item, index) => (
<li
Expand Down Expand Up @@ -256,7 +260,7 @@ function ComboBox() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand All @@ -265,8 +269,12 @@ function ComboBox() {
.filter(
item =>
!inputValue ||
item.title.toLowerCase().includes(inputValue.toLowerCase()) ||
item.author.toLowerCase().includes(inputValue.toLowerCase()),
item.title
.toLowerCase()
.includes(inputValue.toLowerCase()) ||
item.author
.toLowerCase()
.includes(inputValue.toLowerCase()),
)
.map((item, index) => (
<li
Expand Down
16 changes: 8 additions & 8 deletions docs/hooks/useCombobox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -273,7 +273,7 @@ function ComboBoxExample() {
</Box>
<List
className={cx(
!isOpen && 'hidden',
(!isOpen || !items.length) && 'hidden',
'!absolute bg-white w-72 shadow-md max-h-80 overflow-scroll',
)}
{...getMenuProps()}
Expand Down Expand Up @@ -391,7 +391,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -544,7 +544,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -655,7 +655,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -821,7 +821,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -956,7 +956,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -1082,7 +1082,7 @@ function ComboBoxExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps({ref: listRef})}
>
Expand Down
4 changes: 2 additions & 2 deletions docs/hooks/useMultipleSelection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function MultipleComboBoxExample() {
</div>
<ul
className={`absolute w-inherit bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -383,7 +383,7 @@ function MultipleSelectExample() {
</div>
<ul
className={`absolute w-inherit bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!(isOpen && items.length) && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down
14 changes: 7 additions & 7 deletions docs/hooks/useSelect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -311,7 +311,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -436,7 +436,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -524,7 +524,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -664,7 +664,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -784,7 +784,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down Expand Up @@ -885,7 +885,7 @@ function SelectExample() {
</div>
<ul
className={`absolute w-72 bg-white mt-1 shadow-md max-h-80 overflow-scroll p-0 ${
isOpen && items.length ? '' : 'hidden'
!isOpen && 'hidden'
}`}
{...getMenuProps()}
>
Expand Down

0 comments on commit f41971e

Please sign in to comment.