ObjectHeader titlePress not invoked correctly after navigation between views
OpenUI5 version: https://openui5.hana.ondemand.com/resources/sap-ui-core.js - same as navigation sample on UI5 pages Browser/version (+device/version): Chrome any version Any other tested browsers/devices(OK/FAIL): Chrome, android Steps to reproduce the problem: In attached project (taken from your navigation example) - open chrome developer tools and have displayed page shown as on mobile device Open employeeList then click on object header then view navigates to employee detail, then go back repeat like 10+ times after that page is navigated to Home page which is wrong.
What is the expected result? navigation to correct view on object header click What happens instead? url hash reset, wrong view displayed Any other information? (attach screenshot if possible) It seems that is invoked instead of on click handler
Hello @GKSoftwareDevelopment , Error occurs when we run the example in the attached zip file. Please recheck your example or provide a reproducible example by adapting this jsbin https://jsbin.com. Kind regards, Wenqian
Example is working, i forgot to mention that it works when opened in intellij idea/webstorm, so run it using apache/nginx or another webserver.
@GKSoftwareDevelopment I ma testing this application via WebIDe with SAPUI5 1.50.8 built on Dec 20, 2017 and the issue is not reproducible. Steps:
- Run the given code as web application in Chrome
- Click on the "Show Employee List" button from the home screen
- Click on a row of the "Employee List" page, and back button from the "Employee Details" page
- Repeat step '3' several times
- Click on the ObjectHeader of the "Employee List" page, and back button from the "Employee Details" page
- Mix steps 3 and 6 The result is proper navigation to the previous page, where I do not reach the Home page
Please check if the issue is still reproducible, and let us know how to test the project. A video illustrating the steps will be helpful as well
Thanks
We are using OPEN UI5 and issue is still reproducible, try it with OPEN UI5 LTS v1.44.15. It is not possible to change our ui5 version to other than open ui5 other than Long-term maintenance versions.
It took me a while, but I can reproduce it now as well. The problem is with the ObjectHeader alone. It renders an <a>nchor tag as part of the title. And under some circumstances (that I could not fully identify), the default action of the anchor tag's click event is executed (navigate to '#'). This changes the hash part of the URL to the empty string which in turn navigates to appHome.
Navigating back and forth seems not to be part of the problem, it's just necessary to be able to tap (or click) on the title multiple times.
I attached to the native click event (for the ObjectHeader) and tried to understand the scenario in more detail, but couldn't identify the full pattern. In the cases that I observed, the click event was fired on the <span> around the <a>nchor (colored in red in the screenshot below). But not every click on that <span> led to the issue, so there must be more.
I think the ObjectHeader title might have to explicitly cancel the default action of the anchor tag's click event if there's no href (or ensure otherwise that the default action is not executed).
I am still not able to reproduce the problem with the latest OpenUI5 version, nor with 1.44.15 I am checking with the corresponding dev team with ticket #1880015922 if bubbling and default action are prevented on tap/click
Now I have questions to you both :D
- Which browser do you use? (I see Chrome once, and something about Android)
- Is it a touch screen and what is the state of the Touch API setting of the browser?
- Can we have a HAR file that has recorded the requests made while reproducing the problem (we can see at which moment the URL was modified)?
- Can you add console logging in the handler of titlePress of the ObjectHeader and include the log?
- Confirmation that the issue is reproducible in OpenUI5 1.44.15, but not in the latest version.
- Confirmation if "https://openui5.hana.ondemand.com/1.44.25/resources/sap-ui-core.js" reproduces the problem
Thanks
- Chrome, using Device emulation (iPhone 8) - just because I followed the initial description
- no touch screen, MacBook Mid-2016 without a TouchBar, Chrome flag "Touch Event API": Automatic
- Are Hash changes really recorded in the HAR file? No request should go out for a pure hash change
- I had done a similar change already today morning. Please find the log, the HAR and my modified WebApp in the attachment LogHarAndModifedWebApp.zip
- no, can't confirm. Issue also occurs in master (openui5nightly)
Simulating an iPhone in Chrome, reproduces the problem and it is not an appended "#", and the issue is reproducible on iPhone as well :} my bad