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

[iOS] Pressing next into a ListView or TableView goes to last element #13176

Closed
tj-devel709 opened this issue Feb 7, 2023 · 1 comment · Fixed by #13838
Closed

[iOS] Pressing next into a ListView or TableView goes to last element #13176

tj-devel709 opened this issue Feb 7, 2023 · 1 comment · Fixed by #13838
Assignees
Labels
area-controls-entry Entry area-controls-listview ListView and TableView fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working

Comments

@tj-devel709
Copy link
Member

tj-devel709 commented Feb 7, 2023

Description

The code from this PR allows the user to click the "Next" button on the iOS Keyboard (or "enter" on physical keyboard using MacCatalyst) to automatically focus the next UITextField or UITextView (Editor and Entry in Maui).

However, when you press the "Next" button to go into a ListView or TableView, you get sent to the last entry as you can see in the video below:

TableView.mov

It appears that the logical tree reverses the order of the elements in the ListView and TableView and because the Next Navigation uses the logical ordering. Running a slightly different project below, you can see that when we run the maui project on VSMac on MacCatalyst and then attach a debugger inside Xcode and inspect the hierarchy tree, the TableView's entries are backwards.

Steps to see the process in Xcode

  1. Open Xcode
  2. Run the Maui project on MacCatalyst inside VSMac
  3. On Xcode, click the Debug->Attach to Process->{find the maui process and click} dropdown on the top mac toolbar
  4. Press the Debug Spray can icon on the left-side panel
    image
  5. Press the Debug View Hierarchy button (three stacked panels icon) on the bottom bar
  6. Observe the view hierarchy on the left panel

MicrosoftTeams-image (1)

From searching inside the ListViewRenderer (when observing similar behavior in the ListView), it seems that elements are in the correct order inside the DataSource so it appears that somewhere else, things are getting reversed.

Steps to Reproduce

  1. May need to be inside the Maui repo main branch depending on this PR: [iOS] Better Find Next Textfield Algo #13174 (should work to reproduce this inside Maui main branch in the Sandbox)
  2. Add the below xaml
  3. Deploy to an iOS device or use the iOS simulator
  4. Click the first entry that has the text "Initial Entry"
  5. Press the "Next" button on the iOS software keyboard
  6. Observe that you go into the last textfield of the tableview "E3" instead of the expected "E1"
  7. Notice similar behavior inside a ListView as well. (CollectionView works as expected though)
<VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">

            <Entry Text="Initial Entry" ReturnType="Next" />

            <Label Text="TableView" VerticalOptions="End"/>

            <TableView>
                <TableRoot>
                    <TableSection>
                        <EntryCell Label="EntryCell1" Text="E1"/>
                        <EntryCell Label="EntryCell2" Text="E2"/>
                        <EntryCell Label="EntryCell3" Text="E3"/>
                    </TableSection>
                </TableRoot>
            </TableView>
</VerticalStackLayout>

Link to public reproduction project repository

https://github.com/tj-devel709/MauiRepros/tree/main/NextListTableViewIssueRepro

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

iOS 16.2 + MacCatalyst 16.2

Did you find any workaround?

No response

Relevant log output

No response

@tj-devel709 tj-devel709 added t/bug Something isn't working platform/macOS 🍏 macOS / Mac Catalyst platform/iOS 🍎 area-controls-listview ListView and TableView area-controls-entry Entry labels Feb 7, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 7, 2023
@PureWeen PureWeen added this to the Backlog milestone Feb 8, 2023
@ghost
Copy link

ghost commented Feb 8, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@tj-devel709 tj-devel709 self-assigned this Mar 9, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Mar 27, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Apr 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 May 24, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-entry Entry area-controls-listview ListView and TableView fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants