Skip to content

fix(ui-kit): preserve falsy initial and state values#1236

Open
Shreyas2004wagh wants to merge 1 commit intoRocketChat:developfrom
Shreyas2004wagh:fix/ui-kit-preserve-falsy-values
Open

fix(ui-kit): preserve falsy initial and state values#1236
Shreyas2004wagh wants to merge 1 commit intoRocketChat:developfrom
Shreyas2004wagh:fix/ui-kit-preserve-falsy-values

Conversation

@Shreyas2004wagh
Copy link

Acceptance Criteria fulfillment

  • Preserve valid falsy initial values such as 0 and '' in UI Kit value resolution
  • Preserve valid falsy state values from UiKitContext instead of incorrectly falling back to initial values
  • Add regression tests covering falsy initial values and falsy context state values

Fixes #1235

Video/Screenshots

N/A

PR Test Details

  • Added regression tests for getInitialValue
    • preserves empty string initial values
    • preserves zero-valued initial values
    • preserves empty string option values
  • Added regression tests for useUiKitState
    • preserves zero values from context state
    • preserves empty string values from context state
  • Targeted test result: 2 suites passed, 5 tests passed
  • File-scoped lint passed for:
    • packages/ui-kit/src/utils/getInitialValue.js
    • packages/ui-kit/src/hooks/useUiKitState.js

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.

UI Kit falsy values are lost in initial/state resolution for block elements

1 participant