fix: lint

This commit is contained in:
Michael Zetterberg
2024-04-18 18:08:04 +02:00
parent 285f8bdcfa
commit a512cd04b5
4 changed files with 17 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
"use client"
import { useEffect, useRef, useState, type FocusEvent } from "react"
import { useRef } from "react"
import {
Button,
@@ -27,18 +27,11 @@ export default function Select({
value,
}: SelectProps) {
const divRef = useRef<HTMLDivElement>(null)
const [divElement, setDivElement] = useState(divRef.current)
function handleOnSelect(key: Key) {
onSelect(key, name)
}
useEffect(() => {
if (divRef.current) {
setDivElement(divRef.current)
}
}, [divRef.current])
return (
<div className={styles.date} ref={divRef}>
<ReactAriaSelect
@@ -63,7 +56,7 @@ export default function Select({
* by this component to both access css variables assigned
* on the container as well as to not overflow it at any time.
*/
UNSTABLE_portalContainer={divElement ?? undefined}
UNSTABLE_portalContainer={divRef.current ?? undefined}
>
<ListBox className={styles.listBox}>
{items.map((item) => (