Skip to content

Commit

Permalink
chore(Field.Option): remove unused code (#4516)
Browse files Browse the repository at this point in the history
I don't see that the `Field.Option` code is actually used at all 🤔
  • Loading branch information
langz authored Jan 29, 2025
1 parent 2fe99aa commit de8a95b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
19 changes: 2 additions & 17 deletions packages/dnb-eufemia/src/extensions/forms/Field/Option/Option.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import classnames from 'classnames'
import type { FieldProps } from '../../types'

export type Props = FieldProps<number | string> & {
Expand All @@ -9,20 +8,6 @@ export type Props = FieldProps<number | string> & {
style?: React.CSSProperties
}

export default function Option({
className,
title,
text,
children,
}: Props) {
return (
<span
className={classnames('dnb-forms-field-option', className)}
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
role="option"
>
{title ?? children}
{text}
</span>
)
export default function Option(_props: Props) {
return null
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ describe('Field.Option', () => {
const props: Props = {}

it('should render with props', () => {
render(<Field.Option {...props} />)
const option = document.querySelector('[role="option"]')
expect(option).toBeInTheDocument()
const { container } = render(<Field.Option {...props} />)
expect(container).toBeEmptyDOMElement()
})

describe('ARIA', () => {
Expand Down

0 comments on commit de8a95b

Please sign in to comment.