Skip to content

Commit

Permalink
fix(Forms): ensure Form.Card supports spacing props
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 22, 2024
1 parent 8a07477 commit 01555be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
&::before {
top: var(--outline-width); // align background and outline
z-index: 0;
background-color: transparent; // because we inherit the background-color when "outset" is set – but we don't want that in this case
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/dnb-eufemia/src/extensions/forms/Form/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ function Card(props: CardProps) {
return <CardInstance stack outset {...props} />
}

Card._supportsSpacingProps = true

export default Card
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { render } from '@testing-library/react'
import { Form } from '../../..'

describe('Form.Card', () => {
it('should have constant of _supportsSpacingProps', () => {
expect(Form.Card['_supportsSpacingProps']).toBe(true)
})

it('should set "outset" by default', () => {
const { rerender } = render(<Form.Card />)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 01555be

Please sign in to comment.