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

Fix Check Mark Display in Select Component and Update Documentation #365

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YounessHassoune
Copy link

  • This pull request updates the Select component code to fix the check mark on the select options, as it was not displaying. This issue is resolved by passing the value prop to the <Options> component:

Before:

<Options
  testID={testID}
  ref={modal.ref}
  options={options}
  onSelect={onSelectOption}
/>

After:

<Options
  testID={testID}
  ref={modal.ref}
  options={options}
  onSelect={onSelectOption}
  value={value}
/>
  • Additionally, this pull request updates the select usage example in the documentation to reflect the updated Option type. The import statement for the Option type has been changed to OptionType, and the options array has been modified to use this new type.

Before:

import type { Option } from '@/ui';
......
const options: Option[] = [
  { value: 'chocolate', label: 'Chocolate' },
  { value: 'strawberry', label: 'Strawberry' },
  { value: 'vanilla', label: 'Vanilla' },
];
......
onSelect={(option) => setValue(option.value)}
......

After:

import type { OptionType } from '@/ui'
......
const options: OptionType[] = [
  { value: 'chocolate', label: 'Chocolate' },
  { value: 'strawberry', label: 'Strawberry' },
  { value: 'vanilla', label: 'Vanilla' },
];
......
onSelect={(option) => setValue(option)}
......

Copy link

netlify bot commented Oct 9, 2024

Deploy Preview for obytes-starter ready!

Name Link
🔨 Latest commit d63bf8f
🔍 Latest deploy log https://app.netlify.com/sites/obytes-starter/deploys/670628981306100008eacca8
😎 Deploy Preview https://deploy-preview-365--obytes-starter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

Successfully merging this pull request may close these issues.

1 participant