Skip to content

#13727 - sketch - stroke - swiping over stroke skyle selects it - #81

Merged
Zeljko-Predjeskovic merged 1 commit into
developfrom
fix/13727_action_sheet_drag_selects
Sep 3, 2026
Merged

#13727 - sketch - stroke - swiping over stroke skyle selects it#81
Zeljko-Predjeskovic merged 1 commit into
developfrom
fix/13727_action_sheet_drag_selects

Conversation

@Zeljko-Predjeskovic

@Zeljko-Predjeskovic Zeljko-Predjeskovic commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Fixed action sheet returning the wrong item on touch and selecting while scrolling

  • The item tap handler called AcceptPrimary() without ever setting SelectedItem.
    ListBox selects on PointerReleased for touch and pen, not on press, so the
    handler ran before the selection updated and GetResult() returned the
    previously selected item.
  • Any press+release on the same item counted as a tap, so flicking the list to
    scroll it accepted whatever item the finger happened to land on.
  • The tapped item is now resolved from the item visual's DataContext and assigned
    to SelectedItem before AcceptPrimary(), instead of trusting ListBox.SelectedItem.
  • A tap is cancelled either when the pointer travels further than
    IPlatformSettings.GetTapSize, or when a gesture recognizer steals the pointer
    (PointerCaptureLost). Both are needed: ScrollGestureRecognizer only tracks
    touch/pen, so mouse click-drags rely solely on the tap-slop check, and it bails
    out at the scroll boundaries, so overscroll drags never trigger a capture loss
    either. Conversely a normal touch scroll starts at half the tap size, so it
    cancels via capture loss before the slop check would fire.
  • Removed the dead SelectingItemsControl_OnSelectionChanged and
    InputElement_OnKeyUp handlers - neither was wired up in the axaml. Enter and
    Escape are still handled by InputElement_OnKeyDown.

@Zeljko-Predjeskovic
Zeljko-Predjeskovic merged commit b53ae75 into develop Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants