Skip to content

fix: select previous item correctly when deleting from 2-item collection#1714

Open
Manasvibansal1 wants to merge 1 commit into
foss42:mainfrom
Manasvibansal1:fix/remove-request-selection-bug
Open

fix: select previous item correctly when deleting from 2-item collection#1714
Manasvibansal1 wants to merge 1 commit into
foss42:mainfrom
Manasvibansal1:fix/remove-request-selection-bug

Conversation

@Manasvibansal1

@Manasvibansal1 Manasvibansal1 commented Jun 29, 2026

Copy link
Copy Markdown

PR Description

When exactly 2 requests exist and the non-first one is deleted,
itemIds.length > 1 evaluates to false (1 item remains), so newId
falls through to null leaving the main panel blank even though one
request still exists.

Fix: Replace itemIds.length > 1 with idx > 0, mirroring the
existing removeEnvironment logic.

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, This is a one-line logic fix with no new functionality. Existing tests cover this path.

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

@Manasvibansal1

Copy link
Copy Markdown
Author

Hi, I've opened a PR with the fix , replacing itemIds.length > 1 with idx > 0 to mirror the removeEnvironment logic. PR: #1714

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.

bug: Deleting second-of-two requests leaves selection null

1 participant