Skip to content

Bug - DrawerPanelContent - custom styles can get overridden #11821

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 }}

Activity

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

Metadata

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions