Don't trigger SwipeListItem's actions unless they are exposed
ClosedPublic

Authored by icota on Feb 8 2018, 7:11 PM.

Details

Summary

I seem to be able to click through a SwipeListItem's delegate and trigger actions that should be out of reach. There are probably better ways to do this but this fixes it for me.

Diff Detail

Repository
R169 Kirigami
Lint
Lint Skipped
Unit
Unit Tests Skipped
icota created this revision.Feb 8 2018, 7:11 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptFeb 8 2018, 7:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
icota requested review of this revision.Feb 8 2018, 7:11 PM
apol added a subscriber: apol.Feb 9 2018, 1:58 PM

Can you explain a bit better the issue?
Why aren't they exposed? what do you mean by exposing them?
Why is x false?

mart added a subscriber: mart.Feb 9 2018, 2:00 PM

the issue is valid, i'm not sure a check of the item x is a good enough assumption.

in what conditions this click trough happens? i can't seem to be able to reproduce

icota added a comment.Feb 9 2018, 5:49 PM

@mart It's quite reproducible. Start kirigami gallery (I did it on Android) -- go into 'list view' -- bunch of SwipeListItems there -- tap somewhere to the left of the 'swipe icon' (the one you're supposed to drag left) --- you will trigger either action 1 or 2 as evidenced by the notification.

@apol background.x is 0 when the item is not 'swiped' to the left and the action icons are therefore not exposed.

mart added a comment.Feb 15 2018, 7:33 PM

that's how i did it locally tough still need fixes
Item {

id: behindItem
parent: listItem
z: -1
//TODO: a global "open" state
enabled: background.x !== 0

do you want to push this yourself?

icota updated this revision to Diff 27290.Feb 15 2018, 7:49 PM

@mart Only as a favour to you for the more elegant solution. Thanks!

icota updated this revision to Diff 27292.Feb 15 2018, 8:03 PM
mart accepted this revision.Feb 16 2018, 9:43 AM
This revision is now accepted and ready to land.Feb 16 2018, 9:43 AM
icota closed this revision.Feb 16 2018, 11:07 PM