Skip to content

[Bug]: TableToolbarSearch is calling onChangeProp with incorrect parameters when there is a default value #14655

@laramlewis

Description

@laramlewis

Package

carbon-components-react

Browser

No response

Package version

v7.59.8

React version

v16.14.0

Description

In TableToolbarSearch.js, it is calling onChangeProp with two strings instead of an event as expected when a default value is specified.

  useEffect(
    () => {
      if (defaultValue) {
        onChangeProp?.('', defaultValue);
      }
    },
    //eslint-disable-next-line react-hooks/exhaustive-deps
    []
  );

As a result the onChange handler is passed '' instead of an event with a target value.

Reproduction/example

N/A

Steps to reproduce

  • Render a TableToolbarSearch component with a defaultValue and an onChange handler.
  • The onChange handler will be called with an emptyString instead of an event.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

IBM Knowledge Catalog (formally Watson Knowledge Catalog)

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    ⏱ Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions