vuestorefront/storefront-ui

[Bug]: SfSelect uses selected attribute for placeholder option

dkacper opened this issue · 1 comments

Describe the Bug

When using placeholder on SfSelect component I receive an error in the console that says I should not use selected attribute on the select element. I discovered the bug in React, but I think it applies to Vue as well.

SfSelect error

Expected behavior

No errors in the console. According to the error message, placeholder should use defaultValue or value on the select element.

Steps to reproduce

  1. Run React app.
  2. Use SfSelect with any placeholder
  3. See the console.

I'm currently using SFUI v2.2.0, but I can still see this on the v2 master branch. https://github.com/vuestorefront/storefront-ui/blob/v2-develop/packages/sfui/frameworks/react/components/SfSelect/SfSelect.tsx#L67

SFUI version

2.2.0

Framework

React, Next 13

Node version

20

Browser

Brave, Chrome

OS

macOS

Relevant log output

No response

Able to fix / change the documentation?

  • Yes
  • No

Code of Conduct

  • I agree to follow this project's Code of Conduct

Hey @dkacper this issue was fixed in PR . Closing this issue. Thanks