Repository: supabase/supabase
File: apps/studio/components/interfaces/Auth/Users/UsersV2.tsx (TypeScript)

Code before:
              </Button>
              <ButtonTooltip
                type="default"
                icon={<X />}
                className="px-1.5"
                onClick={() => setSelectedUsers(new Set([]))}
                tooltip={{ content: { side: 'bottom', text: 'Cancel selection' } }}
              />
            </div>
          ) : (
            <>
              <div className="flex flex-wrap items-center gap-2">
                <UsersSearch
                  search={search}
                  searchInvalid={searchInvalid}
                  specificFilterColumn={specificFilterColumn}
                  setSearch={setSearch}
                  setFilterKeywords={(s) => {
                    setFilterKeywords(s)
                    setSelectedUser(undefined)
                    sendEvent({
                      action: 'auth_users_search_submitted',
                      properties: {
                        trigger: 'search_input',
                        ...telemetryProps,
                        keywords: search.trim().toLocaleLowerCase(),
                      },
                      groups: telemetryGroups,
                    })
                  }}
                  setSpecificFilterColumn={(value) => {
                    if (value === 'freeform') {
                      setShowFreeformWarning(true)
                    } else {
                      setSpecificFilterColumn(value)
                    }
                  }}
                />

                {showUserTypeFilter && specificFilterColumn === 'freeform' && (
                  <Select_Shadcn_
                    value={filter}
                    onValueChange={(val) => {
                      setFilter(val as Filter)
                      sendEvent({
                        action: 'auth_users_search_submitted',
                        properties: {
                          trigger: 'user_type_filter',
                          ...telemetryProps,
                          user_type: val,
                        },

Review comment (suggestion):
I might recommend just sing `s` here since `search` could be stale due to async state updates and you're already normalizing the value you pass into `setFilterKeywrods` upstream in the `UsersSearch` component:

```suggestion
                        keywords: s,
```

Code after:
              </Button>
              <ButtonTooltip
                type="default"
                icon={<X />}
                className="px-1.5"
                onClick={() => setSelectedUsers(new Set([]))}
                tooltip={{ content: { side: 'bottom', text: 'Cancel selection' } }}
              />
            </div>
          ) : (
            <>
              <div className="flex flex-wrap items-center gap-2">
                <UsersSearch
                  search={search}
                  searchInvalid={searchInvalid}
                  specificFilterColumn={specificFilterColumn}
                  setSearch={setSearch}
                  setFilterKeywords={(s) => {
                    setFilterKeywords(s)
                    setSelectedUser(undefined)
                    sendEvent({
                      action: 'auth_users_search_submitted',
                      properties: {
                        trigger: 'search_input',
                        ...telemetryProps,
                        keywords: s,
                      },
                      groups: telemetryGroups,
                    })
                  }}
                  setSpecificFilterColumn={(value) => {
                    if (value === 'freeform') {
                      setShowFreeformWarning(true)
                    } else {
                      setSpecificFilterColumn(value)
                    }
                  }}
                />

                {showUserTypeFilter && specificFilterColumn === 'freeform' && (
                  <Select_Shadcn_
                    value={filter}
                    onValueChange={(val) => {
                      setFilter(val as Filter)
                      sendEvent({
                        action: 'auth_users_search_submitted',
                        properties: {
                          trigger: 'user_type_filter',
                          ...telemetryProps,
                          user_type: val,
                        },