perf(таблица): стабильные колбэки поиска для SettingsPanel

onSearchNext/onSearchPrevious были стрелками в JSX и ломали memo панели.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andrey Epifancev 2026-10-28 18:09:26 +04:00
parent c724197682
commit 365becc55a

View File

@ -550,6 +550,9 @@ const RealtimeTable = ({ formType, formId, sheetName, direction, year }) => {
[handleNavigateToColumn, searchMatches], [handleNavigateToColumn, searchMatches],
); );
const handleSearchNext = useCallback(() => navigateToSearchMatch(1), [navigateToSearchMatch]);
const handleSearchPrevious = useCallback(() => navigateToSearchMatch(-1), [navigateToSearchMatch]);
const handleSearchKeyDown = useCallback( const handleSearchKeyDown = useCallback(
(event) => { (event) => {
if (event.key !== 'Enter') return; if (event.key !== 'Enter') return;
@ -775,8 +778,8 @@ const RealtimeTable = ({ formType, formId, sheetName, direction, year }) => {
onGlobalFilterChange={handleGlobalFilterChange} onGlobalFilterChange={handleGlobalFilterChange}
globalFilter={globalFilter} globalFilter={globalFilter}
onSearchKeyDown={handleSearchKeyDown} onSearchKeyDown={handleSearchKeyDown}
onSearchNext={() => navigateToSearchMatch(1)} onSearchNext={handleSearchNext}
onSearchPrevious={() => navigateToSearchMatch(-1)} onSearchPrevious={handleSearchPrevious}
searchMatchCount={searchMatches.length} searchMatchCount={searchMatches.length}
searchMatchIndex={searchMatchIndex} searchMatchIndex={searchMatchIndex}
sizeMult={sizeMult} sizeMult={sizeMult}