fix selection style logic

Closes #950
main
Mike Fix 5 years ago
parent 7044cf2531
commit 68d0f0c36b
No known key found for this signature in database
GPG Key ID: 1D85E862314CA79F

@ -113,10 +113,11 @@ class Carbon extends React.PureComponent {
onSelectionChange = changes => { onSelectionChange = changes => {
if (this.state.selectionAt) { if (this.state.selectionAt) {
const css = [ const css = [
changes.bold && `font-weight: ${changes.bold ? 'bold' : 'initial'}`, changes.bold != null && `font-weight: ${changes.bold ? 'bold' : 'initial'}`,
changes.italics && `font-style: ${changes.italics ? 'italic' : 'initial'}`, changes.italics != null && `font-style: ${changes.italics ? 'italic' : 'initial'}`,
changes.underline && `text-decoration: ${changes.underline ? 'underline' : 'initial'}`, changes.underline != null &&
changes.color && `color: ${changes.color} !important` `text-decoration: ${changes.underline ? 'underline' : 'initial'}`,
changes.color != null && `color: ${changes.color} !important`
] ]
.filter(Boolean) .filter(Boolean)
.join('; ') .join('; ')

Loading…
Cancel
Save