SAP / ui5-webcomponents-react

A wrapper implementation for React of the UI5 Web Components that are compliant with the SAP Fiori User Experience
https://sap.github.io/ui5-webcomponents-react/
Apache License 2.0
444 stars 99 forks source link

Filter Bar: Not visible on Windows devices when using hideToggleFiltersButton #5541

Closed Tynopia closed 8 months ago

Tynopia commented 8 months ago

Describe the bug

When we first demonstrated our UI5 App to our colleagues, they encountered a problem where the filter bar was not visible when they used a Windows device. Initially, @thfiedler experienced this issue. After observing this, we asked @huber-nicolas to test it on his Windows device too. Both of them were using wide-screen monitors, yet even when resizing the window, the issue persisted.

By removing hideToggleFiltersButton from the FilterBar (which is working perfectly on Mac) we managed to resolve the issue on Windows devices!

Isolated Example

https://stackblitz.com/edit/github-raarfk?file=src%2FApp.tsx

Reproduction steps

  1. Open the following StackBlitz link on Windows, and you will see that it's not functioning properly.
  2. Go to line 25 of App.tsx and remove hideToggleFiltersButton.
  3. Try running it again on Windows and you'll find it working perfectly fine.

Expected Behaviour

No response

Screenshots or Videos

Without hideToggleFilterButton on Windows

image

With hideToggleFilterButton on Windows

image

UI5 Web Components for React Version

1.25.1

UI5 Web Components Version

1.22.0

Browser

Chrome, Edge

Operating System

Windows

Additional Context

No response

Relevant log output

No response

Declaration

Lukas742 commented 8 months ago

Hi @Tynopia

unfortunately I wasn't able to reproduce this issue, but it seems like that the isPhone() method returns true for you in some cases. Also, hideToggleFiltersButton should have nothing to do with this behavior as showing or hiding the button is independent from the device detection logic. Did you remove the prop without refreshing the page, so that the hot-update updated the component? This would lead to a rerender and if for some reason the user agent changed in that time, isPhone() could return something different. Also keep in mind that generally the component needs to be rerendered to detect device changes. This is an optimization as usually a user doesn't change devices while using an app, so we don't need to register an observer for this.

Can you check what isPhone returns for you in each case?

import { isPhone } from '@ui5/webcomponents-base/dist/Device';
console.log(isPhone());

Also, please provide these informations:

Tynopia commented 8 months ago

We removed the tag and restarted the entire development server. On my device (Mac), isPhone is always false and works with and without hideToggleFiltersButton.

image

On the Windows system from @huber-nicolas, it is not working. It seems that isPhone isn't the solution to the problem. We tried it with and without hideToggleFiltersButton and in both cases, isPhone is false, but it's still not working (as you can see in the console).

image image

Lukas742 commented 8 months ago

Hi @Tynopia

I checked with a windows machine using the same user-agent as provided and I still wasn't able to reproduce this issue.

user-agent: Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

fb_windows

I can really only guess at this point, since I still don't understand how hideToggleFiltersButton can be connected to this issue as it's only used for conditionally rendering the "Hide/Show Filters" button (see here).

Could you please give us some information on this point?

Touch device? (E.g. has a screen that allows controls via touch)

Also could you check these points as well?

How to access @ui5/webcomponents-react via debugger:

Tynopia commented 8 months ago

Sorry, I forgot to write something about touch devices in the last comment. @huber-nicolas's Laptop is a touch device. We tried your tablet print and it's true.


What CSS classes does the filter area include?

It was undefined because no elements were found with this class.

Please use the debugger (see below, how to access @ui5/webcomponents-react) to check the value of initiallyShowFilters.

In the debugger, it returns false because of isTablet as you can see in the screenshot.

image

ui5-webcomponents-react-bot commented 8 months ago

:tada: This issue has been resolved in version v1.26.0 :tada:

The release is available on v1.26.0

Your semantic-release bot :package::rocket: