Skip to content

Bug - DrawerPanelContent - custom styles can get overridden #11821

@gitdallas

Description

@gitdallas

from @jeswanke slack chat:

  1. we added a DrawerPanelContent like so:
        <DrawerPanelContent
            defaultSize="800px"
            style={{ backgroundColor: 'rgb(21, 21, 21)' }}
        >
  1. then DrawerPanelContent does this:
            {...((defaultSize || minSize || maxSize) && {
              style: boundaryCssVars as React.CSSProperties
            })}
            {...props}
  1. so DrawerPanelContent sets defaultSize style, then our style overwrites that with {…props}

Expected behavior
we can use defaultSize, minSize, and maxSize and still use the style prop.


will probably want to either have a style prop separate, or use props.style for the style attribute and ignore it in ...props like

style={{
  ...(defaultSize || minSize || maxSize ? boundaryCssVars : {}),
  ...props.style
}}
{...{ ...props, style: undefined }}

Metadata

Metadata

Assignees

Type

Projects

Status

PR Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions