Skip to content

Commit

Permalink
chore(search): fix regex search boards bug (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindtvedtsebastian authored Jun 6, 2024
1 parent b75f2be commit 2ed9ba4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion next-tavla/app/(admin)/boards/components/TableRows/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ function TableRows({ boards }: { boards: TBoard[] }) {
const columns =
useSearchParam('columns')?.split(',') ?? DEFAULT_BOARD_COLUMNS
const sortFunction = useSortBoardFunction()
const searchFilter = new RegExp(search, 'i')
const searchFilter = new RegExp(
search.replace(/[^a-z/Wæøå0-9- ]+/g, ''),
'i',
)

const filterByTitle = (board: TBoard) =>
searchFilter.test(board?.meta?.title ?? DEFAULT_BOARD_NAME)
Expand Down

0 comments on commit 2ed9ba4

Please sign in to comment.