mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
CHANGE the detection of existingKnob so it just checks the type & name matches
if the name AND type match, it's very likely the same knob, checking the value was slower & caused and issue for me when loading the value from url the first time. Open to other solutions too.
This commit is contained in:
parent
4addccc21a
commit
42b26cf9af
@ -1,5 +1,4 @@
|
||||
/* eslint no-underscore-dangle: 0 */
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import escape from 'escape-html';
|
||||
|
||||
import { getQueryParams } from '@storybook/client-api';
|
||||
@ -63,7 +62,7 @@ export default class KnobManager {
|
||||
// We need to return the value set by the knob editor via this.
|
||||
// But, if the user changes the code for the defaultValue we should set
|
||||
// that value instead.
|
||||
if (existingKnob && deepEqual(options.value, existingKnob.defaultValue)) {
|
||||
if (existingKnob && options.type === existingKnob.type) {
|
||||
return this.getKnobValue(existingKnob);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user