Skip to content

Fix chatButtonStyle width/height customization and added unit tests#370

Open
annicechang05 wants to merge 1 commit into
react-chatbotify:mainfrom
annicechang05:fix-chat-button-style-sizing
Open

Fix chatButtonStyle width/height customization and added unit tests#370
annicechang05 wants to merge 1 commit into
react-chatbotify:mainfrom
annicechang05:fix-chat-button-style-sizing

Conversation

@annicechang05
Copy link
Copy Markdown

Description

This PR fixes an issue where custom chatButtonStyle width and height values were not consistently applied to the chat toggle button.

Closes #361

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to docs/code comments)

What is the proposed approach?

This PR fixes an issue where custom 'chatButtonStyle' width and height values were not consistently applied to the chat toggle button.

Previously, the button’s dimensions were effectively constrained by fixed values defined in 'ChatBotButton.css', which prevented developers from fully customizing the button size using the 'styles' prop.

To resolve this, I

  • Removed the fixed 'width' and 'height' from 'ChatBotButton.css'
  • Defined default dimensions (75×75) directly in 'ChatBotButton.tsx'
  • Ensured that 'chatButtonStyle' values are spread after defaults so user-provided styles properly override them

Checklist:

  • The commit message follows our adopted guidelines
  • Testing has been done for the change(s) added (for bug fixes/features)
  • Relevant comments/docs have been added/updated (for bug fixes/features)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chatButtonStyle does not apply custom width/height

2 participants