Skip to content

Conversation

@ndelangen
Copy link
Member

Fixes: #4402

@ndelangen
Copy link
Member Author

@sapkra This should truly fix the issue.

The problem was indeed that trying to set a rich value as a value on <select> doesn't work.

So In this PR I'm mapping back to the object-key (which should always be a string).

Also simplified the code a bit.

@ndelangen
Copy link
Member Author

If you'd like to review the code perhaps?

@codecov
Copy link

codecov bot commented Oct 23, 2018

Codecov Report

Merging #4522 into master will not change coverage.
The diff coverage is 75%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4522   +/-   ##
======================================
  Coverage    35.7%   35.7%           
======================================
  Files         557     557           
  Lines        6708    6708           
  Branches      879     879           
======================================
  Hits         2395    2395           
  Misses       3858    3858           
  Partials      455     455
Impacted Files Coverage Δ
addons/knobs/src/components/types/Select.js 76.92% <75%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38ae063...c98a11a. Read the comment docs.

@ndelangen ndelangen merged commit 45c4055 into master Oct 23, 2018
@ndelangen ndelangen deleted the knobs/fix-select-richvalues branch October 23, 2018 13:54
const SelectType = ({ knob, onChange }) => {
const { options } = knob;
const entries = Array.isArray(options)
? options.reduce((acc, k) => Object.assign(acc, { k }), {})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be {[k]: k} instead of {k}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

None yet

3 participants