Skip to content

Fixed several bugs in TextFieldWidget - #159

Open
Spaghetti-OberNub wants to merge 1 commit into
masterfrom
fix-empty-text-crash
Open

Fixed several bugs in TextFieldWidget#159
Spaghetti-OberNub wants to merge 1 commit into
masterfrom
fix-empty-text-crash

Conversation

@Spaghetti-OberNub

Copy link
Copy Markdown

Summary

  • Fix empty field crashes: Added ensureNotEmpty() to TextFieldHandler and some bounds checks in TextFieldRenderer.
  • Fix multiline paste crash: Corrected subList target in TextFieldHandler.insert() when inserting >2 lines.
  • Fix height lock in text editors: Bypassed wouldFit() height restriction for multiline fields (maxLines > 1), allowing editors to scroll properly beyond initial height.
  • Automatically filter out carriage return characters (\r) on paste/insert.
  • Added proper setText() methods to TextFieldHandler and BaseTextFieldWidget.

I would be thankful for some additional testing.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy

@Spaghetti-OberNub Spaghetti-OberNub added the Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. label Aug 8, 2026
MCTian-mi added a commit to SymmetricDevs/ModularUI that referenced this pull request Aug 10, 2026
Adds empty-field guards, multiline paste fix, setText helpers and renderer cursor/mark bounds checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant