Skip to content

fix(attributes-to-props): don't convert non-uncontrolled component props#852

Merged
remarkablemark merged 2 commits intomasterfrom
fix/attributes-to-props
Mar 4, 2023
Merged

fix(attributes-to-props): don't convert non-uncontrolled component props#852
remarkablemark merged 2 commits intomasterfrom
fix/attributes-to-props

Conversation

@remarkablemark
Copy link
Copy Markdown
Owner

@remarkablemark remarkablemark commented Mar 4, 2023

What is the motivation for this pull request?

fix(attributes-to-props): don't convert non-uncontrolled component props

Fixes #839

What is the current behavior?

Non-uncontrolled component (e.g., <li>) attributes like value are being converted to defaultValue which is incorrect

What is the new behavior?

Only uncontrolled components have attributes checked and value converted:

  • <input>
  • <select>
  • <textarea>

Non-uncontrolled components are ignored

Checklist:

@remarkablemark remarkablemark added the bug Something isn't working label Mar 4, 2023
@remarkablemark remarkablemark self-assigned this Mar 4, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/html-react-parser.min.js 10.35 KB (+0.22% 🔺) 208 ms (+0.22% 🔺) 35 ms (+122.72% 🔺) 242 ms

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 4, 2023

Codecov Report

Merging #852 (3f0e8dc) into master (8d0f7ad) will not change coverage.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##            master      #852   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          172       174    +2     
  Branches        58        58           
=========================================
+ Hits           172       174    +2     
Impacted Files Coverage Δ
test/data/html.js 100.00% <ø> (ø)
lib/attributes-to-props.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

  Package size limit has exceeded by 7 B
  Size limit:   10.59 kB
  Size:         10.6 kB  with all dependencies, minified and gzipped
  Loading time: 208 ms   on slow 3G
  Running time: 76 ms    on Snapdragon 410
  Total time:   283 ms
@remarkablemark remarkablemark merged commit 09be810 into master Mar 4, 2023
@remarkablemark remarkablemark deleted the fix/attributes-to-props branch March 4, 2023 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list value is not preserved while parsing and rendering in UI.

2 participants