Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Color control automatically pops up, without triggering the control itself #28511

Open
valentinpalkovic opened this issue Jul 10, 2024 · 2 comments · May be fixed by #28561
Open

[Bug]: Color control automatically pops up, without triggering the control itself #28511

valentinpalkovic opened this issue Jul 10, 2024 · 2 comments · May be fixed by #28561

Comments

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Jul 10, 2024

Describe the bug

When visiting a story with a color control, the control will automatically open

Reproduction steps

  1. Go to https://634ff0d0ec053b270775979d-vpmrbjlyny.chromatic.com/?path=/story/addons-controls-basics--undefined
  2. In the controls panel, the color picker is automatically opened

image

Additional context

No response

Copy link
Contributor

greptile-apps bot commented Jul 10, 2024

To resolve the issue where the color control automatically opens, ensure that the startOpen prop is correctly set to false by default in the ColorControl component. Check the implementation in Color.tsx and verify the stories in Color.stories.tsx.

  1. In Color.tsx, ensure startOpen is set to false by default:
export const ColorControl: FC<ColorControlProps> = ({
  name,
  value: initialValue,
  onChange,
  onFocus,
  onBlur,
  presetColors,
  startOpen = false, // Ensure this is set to false
  argType,
}) => {
  // ...
};
  1. In Color.stories.tsx, verify that the startOpen prop is not set to true unless explicitly needed:
export const StartOpen: Story = {
  args: {
    startOpen: true, // Only set to true for this specific story
  },
};

This should prevent the color picker from opening automatically unless specified.

References

/code/lib/blocks/src/controls/Color.tsx
/code/lib/blocks/src/controls/Color.stories.tsx
/code/addons/controls/src/manager.tsx

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Ask Greptile · Edit Issue Bot Settings

@JohnMikko27
Copy link

Hi does this issue still need help? Someone tried to make a PR 2 over 2 months ago but didn't successfully merge. Can I start working on this issue?

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

Successfully merging a pull request may close this issue.

3 participants