Skip to content

Commit cb87e6b

Browse files
authored
Fix group filtering (#33)
1 parent 9db9a27 commit cb87e6b

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run E2E tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
- run: npm install pnpm -g
17+
- run: pnpm install
18+
- run: pnpm playwright install --with-deps
19+
- run: pnpm build
20+
- run: pnpm test
21+
- name: Upload test results
22+
if: always()
23+
uses: actions/upload-artifact@v2
24+
with:
25+
name: playwright-report
26+
path: playwright-report

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.idea
23
.env
34
.env.local
45
.env.development

cmdk/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ const Group = React.forwardRef<HTMLDivElement, GroupProps>((props, forwardedRef)
617617
const headingRef = React.useRef<HTMLDivElement>(null)
618618
const headingId = React.useId()
619619
const context = useCommand()
620-
const render = useCmdk((state) => (!state.search ? true : state.filtered.groups.has(id)))
620+
const render = useCmdk((state) => context.filter() === false ? true : (!state.search ? true : state.filtered.groups.has(id)))
621621

622622
useLayoutEffect(() => {
623623
return context.group(id)

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const config: PlaywrightTestConfig = {
77
testDir: './test',
88
use: {
99
trace: 'on-first-retry',
10-
baseURL: process.env.CI ? process.env.BASE_URL : 'http://localhost:3000',
10+
baseURL: 'http://localhost:3000',
1111
},
1212
timeout: 5000,
1313
webServer: {

0 commit comments

Comments
 (0)