Skip to content

Bug - CodeEditorControl - Must supply icon prop even when using isSettings variaint #12065

@logonoff

Description

@logonoff

PF 6.3.1

Describe the problem
A clear and concise description of the problem. Which components are affected?

You can supply isSettings to CodeEditorControl for it to provide a gear icon with a cool animation. However you will get a type error

How do you reproduce the problem?
Provide steps to reproduce. A codesandbox demonstrating the problem is appreciated.

      <CodeEditorControl // type error
        isSettings
        aria-label={t('Editor settings')}
        tooltipProps={{ content: t('Editor settings') }}
        onClick={() => setIsModalOpen(true)}
      />

Expected behavior
A clear and concise description of the expected behavior.

icon prop is not required when isSettings / isFavourite prop is present

Is this issue blocking you?
List the workaround if there is one.

No. Workaround:

      <CodeEditorControl
        icon={undefined}  // fixed!!
        isSettings
        aria-label={t('Editor settings')}
        tooltipProps={{ content: t('Editor settings') }}
        onClick={() => setIsModalOpen(true)}
      />

What is your product and what release date are you targeting?

OCP 4.21 / OCP 4.22

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions