From 96af93e1b7a24b9859e6628d94dc3d6ae9941a7f Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 11 Jan 2024 19:49:56 -0300 Subject: [PATCH] [OSCI][BUG] Fixing bug in icon-only buttons for showing info tooltip when hovered (#1160) * fixing bug in icon-only buttons for showing info tooltip Signed-off-by: Samuel Valdes Gutierrez * Updating test snapshoots related to change in button_content.tsx Signed-off-by: Samuel Valdes Gutierrez * Updating chanelog.md regarding update in OuiButtonContent Signed-off-by: Samuel Valdes Gutierrez * updating button_content.tsx using recomendation of mantainer (include undefined in className instead of empty string) Signed-off-by: Samuel Valdes Gutierrez * updating test snapshoots for button_content.tsx Signed-off-by: Samuel Valdes Gutierrez * adding title prop to OuiIcon component, removing wrapping span element in buttonIcon and updating snapshots Signed-off-by: Samuel Valdes Gutierrez * refactoring code for buttonIcon variable to keep more concise definition Signed-off-by: Samuel Valdes Gutierrez --------- Signed-off-by: Samuel Valdes Gutierrez --- CHANGELOG.md | 1 + src/components/button/button_content.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aab1034ce7..754720fdba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Extract build archive into a folder for OSD integration test CI ([#1075](https://github.com/opensearch-project/oui/pull/1075)) - Correct file path for import of Query component ([#1069](https://github.com/opensearch-project/oui/pull/1069)) - Fix "Guidelines" documentation links rendering blank pages ([#1111](https://github.com/opensearch-project/oui/pull/1111)) +- Fix bug in OuiButtonContent for showing info tooltip in icon-only buttons when hovered([#1160](https://github.com/opensearch-project/oui/pull/1160)) - Fix playground support check ([#1162](https://github.com/opensearch-project/oui/pull/1162)) ### 🚞 Infrastructure diff --git a/src/components/button/button_content.tsx b/src/components/button/button_content.tsx index 3c260aeb47..a4a5bb8a7f 100644 --- a/src/components/button/button_content.tsx +++ b/src/components/button/button_content.tsx @@ -96,6 +96,7 @@ export const OuiButtonContent: FunctionComponent< className="ouiButtonContent__icon" type={iconType} size={iconSize} + title={textProps?.title} color="inherit" // forces the icon to inherit its parent color /> );