Skip to content

[Bug] plugin overrides react-chatbotify themes/styles instead of merging — breaks host app styles #6

@kareemkhalil

Description

@kareemkhalil

The @rcb-plugins/input-validator plugin, when imported and used, replaces/overrides the host app's react-chatbotify theme and styles (themes and styles passed to the ChatBot component). As a result the ChatBot's themes and explicit styles prop are ignored or mutated and the host UI layout/styles are broken.

Steps To Reproduce:

  1. Create a ChatBot with a custom theme and explicit styles prop, for example:
// import and use HtmlRenderer + InputValidator plugins
const plugins = [ HtmlRenderer(), InputValidator(inputValidatorConfig) ];

const themes = [{ id: "minimal_midnight", version: "0.1.0" }];

<ChatBot
  flow={flow}
  themes={themes}
  plugins={plugins}
  styles={{
    chatWindowStyle: { height: "100vh", borderRadius: 0, width: "100%" },
    bodyStyle: { paddingLeft: 10, paddingRight: 10 },
    userBubbleStyle: { marginTop: 10, marginBottom: 3 }
  }}
/>
  1. Run the app and observe that after adding InputValidator the specified themes and styles are overridden or ignored.
  2. Check the rendered chat — the greeting repeats or layout/styling are different from expected.

Expected behavior: Plugin should not override or mutate the host ChatBot's [themes] or [styles] objects.

Library version:
0.3.0

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions