From 9de1c79da6110df752711b1ee8188066b56ba978 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Wed, 15 Jan 2025 02:03:28 -0500 Subject: [PATCH] Update IconButtonWithMenu to use shorter prop name to not conflict with the react key --- src/views/Chores/IconButtonWithMenu.jsx | 8 ++++---- src/views/Chores/MyChores.jsx | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/views/Chores/IconButtonWithMenu.jsx b/src/views/Chores/IconButtonWithMenu.jsx index 2ad1706..8d627b7 100644 --- a/src/views/Chores/IconButtonWithMenu.jsx +++ b/src/views/Chores/IconButtonWithMenu.jsx @@ -5,7 +5,7 @@ import { getTextColorFromBackgroundColor } from '../../utils/Colors.jsx' const IconButtonWithMenu = ({ label, - key, + k, icon, options, onItemSelect, @@ -72,14 +72,14 @@ const IconButtonWithMenu = ({ )} {title && ( - + {title} @@ -87,7 +87,7 @@ const IconButtonWithMenu = ({ )} {options?.map(item => ( { onItemSelect(item) setSelectedItem?.selectedItem(item.name) diff --git a/src/views/Chores/MyChores.jsx b/src/views/Chores/MyChores.jsx index 16e0055..21f5e79 100644 --- a/src/views/Chores/MyChores.jsx +++ b/src/views/Chores/MyChores.jsx @@ -420,11 +420,7 @@ const MyChores = () => { setActiveTextField('search') setSearchInputFocus(searchInputFocus + 1) - searchInputRef.current.focus() - searchInputRef.current.selectionStart = - searchInputRef.current.value?.length - searchInputRef.current.selectionEnd = - searchInputRef.current.value?.length + searchInputRef?.current?.focus() }} > @@ -434,6 +430,7 @@ const MyChores = () => { } options={[ { name: 'Due Date', value: 'due_date' }, @@ -456,7 +453,7 @@ const MyChores = () => {
} options={Priorities} selectedItem={selectedFilter}