Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voiceOver focuses on wrong block when placing block #292

Open
lucyrubin opened this issue Jun 20, 2024 · 2 comments
Open

voiceOver focuses on wrong block when placing block #292

lucyrubin opened this issue Jun 20, 2024 · 2 comments

Comments

@lucyrubin
Copy link
Collaborator

Sometimes focus goes in the middle of the program instead of the start of the program.

Likely because of setting: collectionView.remembersLastFocusedIndexPath = true

We only want that property to be true right after placing a block, not while placing block

@lucyrubin
Copy link
Collaborator Author

helpful way to force focus: UIAccessibility.post(notification: .screenChanged, argument: self.blocksProgram)

@lucyrubin
Copy link
Collaborator Author

lucyrubin commented Jul 8, 2024

This isn't the greatest solution, but it could be helpful. Add these code lines to the bottom of the addBlocks() method in BlocksViewController to focus voiceover on a block after placing it instead of focusing on the toolbox:

DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: {
           
            if indexPath != nil {
               
                if let cell = self.blocksProgram.cellForItem(at: indexPath!) {
           
                    UIAccessibility.post(
                        notification: UIAccessibility.Notification.layoutChanged,
                        argument: cell
                    )
                }
            }
        })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants