Skip to content

Commit

Permalink
fix: dropdown with image display (#5101)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainseb authored Jan 3, 2024
1 parent 3c5082b commit e08217c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/thin-cherries-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@talend/react-components': patch
'@talend/bootstrap-theme': patch
---

fix: dropdown with image display
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ $tc-dropdown-button-right-padding: 0.8rem;
}

&-item {
a img {
max-width: initial;
}

a img,
a svg {
margin: 0 $padding-smaller;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Immutable from 'immutable';
import { action } from '@storybook/addon-actions';
import Immutable from 'immutable';

import ActionDropdown from './ActionDropdown.component';
import FilterBar from '../../FilterBar';
import Action from '../Action';
import ActionDropdown from './ActionDropdown.component';

const myAction = {
id: 'context-dropdown-related-items',
Expand All @@ -17,6 +17,12 @@ const myAction = {
'data-feature': 'actiondropdown.items',
onClick: action('document 1 click'),
},
{
icon: 'src-data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+CiAgPGc+CiAgICA8cGF0aCBjbGFzcz0idGktYmFja2dyb3VuZCIgIGZpbGw9IiNGRjZFNzAiIGQ9Ik0xNiw4IEMxNiwxMi40MTg4NzM3IDEyLjQxODI2NDgsMTYuMDAwNjA4OCA4LDE2LjAwMDYwODggQzMuNTgxNzM1MTYsMTYuMDAwNjA4OCAwLDEyLjQxODg3MzcgMCw4IEMwLDMuNTgxNzM1MTYgMy41ODE3MzUxNiw1LjM0OTk2ODgzZS0xNCA4LDUuMzQ5OTY4ODNlLTE0IEMxMi40MTgyNjQ4LDUuMzQ5OTY4ODNlLTE0IDE2LDMuNTgxNzM1MTYgMTYsOCIvPgogICAgPHB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uMDQ2OTMxMSA5LjY2MzEyNjA1LDExLjkyOTU1MjkgQzkuODk2MDY3MjMsMTEuODEyNzc5OCAxMC4wNjcyOTQxLDExLjY5NDE5MTYgMTAuMTc4MDE2OCwxMS41NzM3ODgyIEMxMC4yMDQ2Mzg3LDExLjU1Njg0NzEgMTAuMjA0NjM4NywxMS41MDkwNDg3IDEwLjE3ODAxNjgsMTEuNDMxNjAzNCIvPgogIDwvZz4KPC9zdmc+Cg==',
label: 'Button with icon as image',
onClick: action('Button with icon clicked'),
type: 'button',
},
{
divider: true,
},
Expand Down
1 change: 1 addition & 0 deletions packages/theme/src/theme/_dropdowns.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ $dropdown-caret-up-axis: -45deg !default;
color: tokens.$coral-color-neutral-text;
}

> img:first-child,
> svg:first-child {
margin-right: $padding-small;
}
Expand Down

0 comments on commit e08217c

Please sign in to comment.