Skip to content

fix: Text input fields on ModalBlockView fail to accept user input#6980

Merged
OtavioStasiak merged 11 commits intodevelopfrom
fix.modal-block-input-not-working
Feb 21, 2026
Merged

fix: Text input fields on ModalBlockView fail to accept user input#6980
OtavioStasiak merged 11 commits intodevelopfrom
fix.modal-block-input-not-working

Conversation

@OtavioStasiak
Copy link
Copy Markdown
Contributor

@OtavioStasiak OtavioStasiak commented Feb 12, 2026

Proposed changes

Text input fields on ModalBlockView fail to accept user input.

Issue(s)

https://rocketchat.atlassian.net/browse/SUP-993

How to test or reproduce

  • open the app (open server);
  • Go to a room and type /poll and click on send;
  • type on input;

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • [X ] I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Added an interactive modal example allowing users to add input fields dynamically with per-field value tracking.
  • Refactor

    • Simplified modal component behavior to improve stability and preserve input focus while typing, reducing unexpected remounts when modal content changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 12, 2026

Walkthrough

Refactors the modal wrapper from a curried factory to a single-component export, updates the modal view to use the refactor with a computed modalKey for controlled remounting, and adds a story demonstrating dynamic input fields with add-field functionality and per-field state.

Changes

Cohort / File(s) Summary
Modal Component Refactoring
app/containers/UIKit/MessageBlock.tsx, app/views/ModalBlockView.tsx
Renamed and converted modalBlockWithContext (curried) → ModalBlockWithContext (single-component props). Provider now receives props directly (value={props}) and inner ModalBlock receives ...props. ModalBlockView imports the new export and introduces a computed modalKey to drive remounts; changeState now calls this.setState({}) after mutating this.values.
New Interactive Story
app/containers/UIKit/UiKitModal.stories.tsx
Adds ModalInputWithAddField story: initial input blocks, changeState to track per-field values, addField to append inputs with generated actionIds/labels, and a computed modalKey used when rendering the modal; exposes an "Add field" button to add inputs at runtime.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop, a prop, a single pass,
The modal sheds its curried past.
Fields sprout up with joyous cheer,
Keys keep focus, state is near.
I nibble bugs and dance on screen—hooray! 🥕

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Text input fields on ModalBlockView fail to accept user input' accurately summarizes the main objective of the PR—addressing an input acceptance issue in ModalBlockView through refactoring and state management improvements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@OtavioStasiak OtavioStasiak temporarily deployed to experimental_android_build February 13, 2026 02:24 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak marked this pull request as ready for review February 13, 2026 15:57
@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build February 13, 2026 16:41 — with GitHub Actions Error
@OtavioStasiak OtavioStasiak changed the title fix: input saving the text typed and breaking the app on add a new op… fix: Text input fields on ModalBlockView fail to accept user input. Feb 13, 2026
@diegolmello diegolmello changed the title fix: Text input fields on ModalBlockView fail to accept user input. fix: Text input fields on ModalBlockView fail to accept user input Feb 20, 2026
@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build February 20, 2026 17:40 — with GitHub Actions Error
@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build February 20, 2026 19:14 — with GitHub Actions Error
@OtavioStasiak OtavioStasiak merged commit 895ebf0 into develop Feb 21, 2026
162 of 333 checks passed
@OtavioStasiak OtavioStasiak deleted the fix.modal-block-input-not-working branch February 21, 2026 02:26
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.

2 participants