fix: suppress downshift props errors

This commit is contained in:
trafficlunar 2025-04-12 14:51:32 +01:00
parent 4d1cda8348
commit 9f50c3e720

View file

@ -70,8 +70,6 @@ export default function QrScanner({ isOpen, setIsOpen, setQrBytesRaw }: Props) {
const code = jsQR(imageData.data, imageData.width, imageData.height); const code = jsQR(imageData.data, imageData.width, imageData.height);
if (!code) return; if (!code) return;
console.log(code);
// Cancel animation frame to stop scanning // Cancel animation frame to stop scanning
if (requestRef.current) { if (requestRef.current) {
cancelAnimationFrame(requestRef.current); cancelAnimationFrame(requestRef.current);
@ -148,7 +146,11 @@ export default function QrScanner({ isOpen, setIsOpen, setQrBytesRaw }: Props) {
<label className="text-sm font-semibold">Camera:</label> <label className="text-sm font-semibold">Camera:</label>
<div className="relative w-full"> <div className="relative w-full">
{/* Toggle button to open the dropdown */} {/* Toggle button to open the dropdown */}
<button type="button" {...getToggleButtonProps()} className="pill input w-full !px-2 !py-0.5 !justify-between text-sm"> <button
type="button"
{...getToggleButtonProps({}, { suppressRefError: true })}
className="pill input w-full !px-2 !py-0.5 !justify-between text-sm"
>
{selectedItem?.label || "Select a camera"} {selectedItem?.label || "Select a camera"}
<Icon icon="tabler:chevron-down" className="ml-2 size-5" /> <Icon icon="tabler:chevron-down" className="ml-2 size-5" />
@ -156,7 +158,7 @@ export default function QrScanner({ isOpen, setIsOpen, setQrBytesRaw }: Props) {
{/* Dropdown menu */} {/* Dropdown menu */}
<ul <ul
{...getMenuProps()} {...getMenuProps({}, { suppressRefError: true })}
className={`absolute z-50 w-full bg-orange-200 border-2 border-orange-400 rounded-lg mt-1 shadow-lg max-h-60 overflow-y-auto ${ className={`absolute z-50 w-full bg-orange-200 border-2 border-orange-400 rounded-lg mt-1 shadow-lg max-h-60 overflow-y-auto ${
isDropdownOpen ? "block" : "hidden" isDropdownOpen ? "block" : "hidden"
}`} }`}