Skip to content

Commit 184100d

Browse files
fix(lxlweb): expand supersearch on pill click (#1698)
* ignore events on qualifier widget (let clicks reach supersearch.showExpandedSearch) * update theme extension css * add test
1 parent 18d0b4f commit 184100d

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎lxl-web/tests/supersearch-lxlweb.spec.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ test('click input expands dialog', async ({ page }) => {
1212
await expect(dialog).toHaveAttribute('open');
1313
});
1414

15+
test('clicking a qualifier pill expands dialog', async ({ page }) => {
16+
await page.goto(
17+
'/find?_q=workCategory%3A"saogf%3AFacklitteratur"+&_limit=20&_offset=0&_sort=&_spell=true'
18+
);
19+
const dialog = await page.locator('#appbar-lg-search-dialog');
20+
await expect(dialog).not.toHaveAttribute('open');
21+
await page.getByTestId('supersearch').locator('.atomic').first().click({ force: true });
22+
await expect(dialog).toHaveAttribute('open');
23+
});
24+
1525
test('type & enter performs search', async ({ page }) => {
1626
await page.getByTestId('supersearch').getByRole('combobox').fill('hej');
1727
await page.keyboard.press('Enter');

‎packages/supersearch/src/lib/extensions/lxlQualifierPlugin/qualifierDecoration.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class QualifierWidget extends WidgetType {
4141
}
4242
};
4343

44+
this.ignoreEvent = () => {
45+
return false;
46+
};
47+
4448
const render = view.state.facet(qualifierRenderFacet);
4549
if (render) {
4650
const result = render(container, this.props);

‎packages/supersearch/src/lib/extensions/theme.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ export const theme = EditorView.theme({
1414
},
1515
'&.cm-focused .cm-selectionBackground': {
1616
background: '#3b82f640!important'
17+
},
18+
'.cm-selectionBackground': {
19+
background: '#3b82f640!important'
1720
}
1821
});

0 commit comments

Comments
 (0)