Skip to content

[WC-2886]: DG2 Filters floating positioning fix #1526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue with filter popup positioning.

## [2.11.2] - 2025-03-20

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mendix/datagrid-date-filter-web",
"widgetName": "DatagridDateFilter",
"version": "2.11.2",
"version": "2.11.3",
"description": "",
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ exports[`Date Filter with single instance with double attributes renders correct
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:ra:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<div
Expand Down Expand Up @@ -103,13 +96,6 @@ exports[`Date Filter with single instance with single attribute renders correctl
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:r0:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ exports[`Filter component renders correctly 1`] = `
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:r0:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<div
Expand Down Expand Up @@ -153,13 +146,6 @@ exports[`Filter component renders correctly with aria labels 1`] = `
>

</button>
<ul
aria-label="my label"
class="filter-selectors hidden"
id="downshift-:r3:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="DatagridDateFilter" version="2.11.2" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="DatagridDateFilter" version="2.11.3" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="DatagridDateFilter.xml" />
</widgetFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue with filter popup positioning.

## [2.10.0] - 2025-02-20

### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mendix/datagrid-dropdown-filter-web",
"widgetName": "DatagridDropdownFilter",
"version": "2.10.0",
"version": "2.10.1",
"description": "",
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="DatagridDropdownFilter" version="2.10.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="DatagridDropdownFilter" version="2.10.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="DatagridDropdownFilter.xml" />
</widgetFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue with filter popup positioning.

## [2.9.1] - 2025-03-20

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mendix/datagrid-number-filter-web",
"widgetName": "DatagridNumberFilter",
"version": "2.9.1",
"version": "2.9.2",
"description": "",
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ exports[`Number Filter with single instance with multiple attributes renders cor
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:r7:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<input
Expand Down Expand Up @@ -78,13 +71,6 @@ exports[`Number Filter with single instance with single attribute renders correc
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:r0:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="DatagridNumberFilter" version="2.9.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="DatagridNumberFilter" version="2.9.2" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="DatagridNumberFilter.xml" />
</widgetFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue with filter popup positioning.

## [2.9.1] - 2025-03-20

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mendix/datagrid-text-filter-web",
"widgetName": "DatagridTextFilter",
"version": "2.9.1",
"version": "2.9.2",
"description": "",
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ exports[`Text Filter with single instance with multiple attributes renders corre
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:r8:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<input
Expand Down Expand Up @@ -78,13 +71,6 @@ exports[`Text Filter with single instance with single attribute renders correctl
>

</button>
<ul
aria-label="Select filter type"
class="filter-selectors hidden"
id="downshift-:r5:-menu"
role="listbox"
style="position: fixed; left: 0px; top: 0px; transform: translate(0px, 0px);"
/>
</div>
</div>
<input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="DatagridTextFilter" version="2.9.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="DatagridTextFilter" version="2.9.2" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="DatagridTextFilter.xml" />
</widgetFiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { FloatingPortal } from "@floating-ui/react";
import classNames from "classnames";
import { createElement, useMemo } from "react";
import { useSelect } from "./useSelect";
Expand Down Expand Up @@ -38,26 +39,29 @@ export function FilterSelector(props: FilterSelectorProps): React.ReactElement {
>
&nbsp;
</button>
<ul
className={classNames("filter-selectors", { hidden: !open, visible: open })}
{...listboxProps}
style={floatingStyles}
>
{open &&
options.map((item, index) => (
<li
className={classNames("filter-listitem", {
"filter-selected": selectedItem?.value === item.value,
"filter-highlighted": highlightedIndex === index
})}
key={item.value}
{...getItemProps({ item, index })}
>
<div className={classNames("filter-icon", item.value)} aria-hidden />
<div className="filter-label">{item.caption}</div>
</li>
))}
</ul>
{open && (
<FloatingPortal>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably cause z-index issues

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other option was to switch the floatingUI strategy(position) to absolute, which I believe would cause even more issues, I'll see the e2e's to make sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The snapshot tests are also passing, you think we can head on? @iobuhov

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, no problem. I think can be tested by Leo

<ul
className={classNames("filter-selectors", { hidden: !open, visible: open })}
{...listboxProps}
style={floatingStyles}
>
{options.map((item, index) => (
<li
className={classNames("filter-listitem", {
"filter-selected": selectedItem?.value === item.value,
"filter-highlighted": highlightedIndex === index
})}
key={item.value}
{...getItemProps({ item, index })}
>
<div className={classNames("filter-icon", item.value)} aria-hidden />
<div className="filter-label">{item.caption}</div>
</li>
))}
</ul>
</FloatingPortal>
)}
</div>
</div>
);
Expand Down
Loading