openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Tree press event not fired if you click where the arrow would have been (had it not been a leaf node)

Open ghost opened this issue 7 years ago • 13 comments

OpenUI5 version: 1.67.0

Browser/version (+device/version): Chrome 75.0.3770.100

Any other tested browsers/devices(OK/FAIL): N/A

URL (minimal example if possible): Running example file attached.

User/password (if required and possible - do not post any confidential information here): N/A

Steps to reproduce the problem:

  1. Run the attached example
  2. Click on a leaf node where the arrow icon would be had it not been a leaf node.

What is the expected result? Since the leaf node has no arrow, I expect clicking anywhere on the item will generate the click event.

What happens instead? Nothing happens. The click even only occurs if you click in the area of the text. This is not in any way evident in the UI. Nett result is, users have the feeling sometimes the tree doesn't work.

Any other information? (attach screenshot if possible). N/A

ghost avatar Jul 11 '19 12:07 ghost

Hi @srenwickblum

Thank you for sharing this finding. I've created an internal incident 1970364589. The status of the issue will be updated here in GitHub.

Kind Regards, Gery

gerym avatar Jul 22 '19 11:07 gerym

Hi,

thanks for your question.

You can change the type of the treeitem to make it active, then the event fires. You can find the API document under "properties - type": https://openui5.hana.ondemand.com/#/api/sap.m.TreeItemBase and examples under: https://openui5.hana.ondemand.com/#/entity/sap.m.List/sample/sap.m.sample.ListItemTypes

Best regards, Wenqian Wang (UI5 dev)

awui avatar Aug 14 '19 14:08 awui

Hi @srenwickblum ,

Please see my comment above as a solution.

Best, Wenqian

awui avatar Aug 14 '19 14:08 awui

@awui Just a few points on your answer above:

  • My example which I included actually has type set to Active.
  • Setting type="Active" does NOT resolve this issue
  • This is not a consulting ticket, this is likely a side effect from the pointer icon being made transparent and swallowing the event it should have allowed through to the ListItem (in this case)

Please re-open this ticket and remove the consulting tag, Thank you.

ghost avatar Aug 19 '19 11:08 ghost

@matz3 Are you able to re-open this ticket? awui must be too busy right now.

ghost avatar Aug 26 '19 07:08 ghost

@matz3 Thank you!!

ghost avatar Aug 26 '19 08:08 ghost

Dear @srenwickblum ,

Thanks for your report. We have checked your example again.

The Tree control is based on Treebinding. Currently clicking on the leaf's expander won't fire any change event, as the tree binding does not support the event fire on the leaf node. Therefore there is no UI change in this case.

If you want to fire event on the leaf item, you can just use the same way as in your example.

In case you have any further questions, do not hesitate to contact us.

Best regards, Wenqian

awui avatar Aug 26 '19 12:08 awui

@matz3 Help

ghost avatar Aug 26 '19 12:08 ghost

@matz3 Help

with regards to what?

matz3 avatar Aug 26 '19 14:08 matz3

@srenwickblum

Structure in DOM:

  • LI -- SPAN for the collapse/expand of a node, which is not visible for nodes without subnodes -- DIV with the node details which is clickable and triggers press for active ListItem

If the space bothers you, you can add visual element via icon of the StandardListItem

stephania87 avatar Aug 26 '19 14:08 stephania87

@matz3 I had the feeling you understood the issue - so I was asking for your help in stopping @awui repeatedly closing it without fixing it. @stephania87 yes, this is exactly the structure and the issue is with leaf nodes the SPAN swallows the events. I feel my textual explanations are not working, I'll try in picture form :-) image

In the image above, the green boxes indicate where users can click to select the item. The red boxes indicate invisible dead zones where clicking has no effect.

Although we know why this is, the users are given no visual clues that part of the tree item has these dead zones where clicking has no effect. To the end user, a tree leaf node will look identical to a list item. They will notice that clicking the item works most times, but some times it just doesn't work. Eventually (with luck) they will figure out that it works reliably ONLY when you click on the text (or any where to the right of the text). Area's to the left of the text are "somehow" hit and miss (from their perspective).

Again. its crystal clear to me why the event is not passed through to the tree item div's event listener, but I hope by now its clear to you why this is confusing for the user.

I've looked into the code myself and the tree.onItemExpanderPressed() is fired. Presumably since its a leaf node oItem.getExpanded() is returning undefined, triggering a toggleIndex(); This actually looks like it kicks off the TreeRenderer. It seems to run through every node in the tree and then do nothing. Its exactly at this point (onItemExpanderPressed) that we could delegate the event to the item itself. As a bonus the call to the TreeRenderer (and all the cycles that is costing) would be avoided.

ghost avatar Aug 27 '19 07:08 ghost

@srenwickblum Actually everyone has a domain of expertise and these areas are not covering usually. This is why we forward to the corresponding team which can answer the question. Sometimes while checking notifications we see some non technical request and we do it, which does not mean the person had the time to review the whole conversation and the technical part. In this case, you try to workaround the colleagues who handle the Tree control :) The best will be to explain that beside the technical justification you want something else, and to describe the business case and your suggestion (done in your comment above) to them. From that point you will have to provide time to colleagues to reach to the issue again and to re-review it.

stephania87 avatar Aug 27 '19 09:08 stephania87

Hi @srenwickblum ,

Thank you for your information.

We have investigated the issue again and decide to forward this issue to our architect for a better solution.

Best regards, Wenqian

awui avatar Aug 27 '19 11:08 awui