Skip to content

fix (iOS, Android, Web): Exit lists on empty item enter - #859

Open
szydlovsky wants to merge 5 commits into
mainfrom
@szydlovsky/exit-lists-on-empty-enter
Open

szydlovsky wants to merge 5 commits into
mainfrom
@szydlovsky/exit-lists-on-empty-enter

Conversation

@szydlovsky

@szydlovsky szydlovsky commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes issue #810, initially reported on only iOS but happens on all platforms.

Entering an empty list item just kept adding more points instead of terminating the style.

Now it finishes the list, which is a pretty uniform behaviour across many text editors.

Works for all 3 list types (ordered, unordered, checked) on all 3 platforms.

Test Plan

Launch any app, create a list and try entering an empty item.

Screenshots / Videos

After:

iOS:

Screen.Recording.2026-11-09.at.12.21.43.mov

Android:

Screen.Recording.2026-11-09.at.12.25.01.mov

Web:

Screen.Recording.2026-11-09.at.12.05.22.mov

Compatibility

OS Implemented
iOS ✅
Android ✅
Web ✅

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Pressing Enter at the start of a populated Android list item incorrectly removes its list formatting instead of splitting it; the exit path needs an empty-new-paragraph check and a regression test.

1 open issue
What changed in this PR

This PR addresses #810 by making Enter on an empty list item exit the list in EnrichedTextInput across iOS, Android, and Web.

Changes:

  • Adds native handling for exiting empty ordered, unordered, and checkbox list items.
  • Updates Web keyboard handling to lift empty items out of lists.
  • Adjusts browser tests and the native scrolling flow for the new behavior.
File Description
src/​web/​formats/​listKeyboard.ts Lifts empty list items while preserving alignment.
ios/​utils/​ParagraphAttributesUtils.mm Implements empty-item newline handling.
ios/​utils/​ParagraphAttributesUtils.h Declares the new newline handler.
ios/​EnrichedTextInputView.mm Runs the handler before checkbox newline handling.
android/​src/​main/​java/​com/​swmansion/​enriched/​textinput/​styles/​ListStyles.kt Adds empty-item list exit handling.
.playwright/​tests/​listKeyboard.spec.ts Updates list-exit and scrolling scenarios.
.maestro/​enrichedInput/​flows/​scrolling_with_paragraph_styles.yaml Removes an extra Enter from the scrolling flow.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

[iOS, Android, Web] Return on an empty list item adds another item instead of ending the list

2 participants