Skip to content

Commit

Permalink
Accessibility scrolling enhancements (#283)
Browse files Browse the repository at this point in the history
* add scrolling callbacks to accessibility methods

* fixup! add scrolling callbacks to accessibility methods

---------

Co-authored-by: Andrew Williams <[email protected]>
  • Loading branch information
andrewwilliams and Andrew Williams authored Nov 22, 2023
1 parent a569fbc commit 76b8bd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed an issue that could cause the calendar to layout unnecessarily due to a trait collection change notification
- Fixed an issue that could cause off-screen items to appear or disappear instantly, rather than animating in or out during animated content changes
- Fixed an issue that caused a SwiftUI view being used as a calendar item to not receive calls to `onAppear`
- Fixed an accessibility issue that prevented scrolling callbacks from firing when scrolling via voiceover.

### Changed
- Removed all deprecated code, simplifying the public API in preparation for a 2.0 release
Expand Down
7 changes: 7 additions & 0 deletions Sources/Public/CalendarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,13 @@ extension CalendarView {
let accessibilityScrollText = targetMonthView.accessibilityLabel
UIAccessibility.post(notification: .pageScrolled, argument: accessibilityScrollText)

// ensure that scrolling related callbacks are still fired when performing scrolling via accessibility
if let visibleDayRange {
didScroll?(visibleDayRange, false)
didEndDragging?(visibleDayRange, true)
didEndDecelerating?(visibleDayRange)
}

return true
}

Expand Down

0 comments on commit 76b8bd8

Please sign in to comment.