Skip to content

Commit

Permalink
fix custom text color at editor #1937
Browse files Browse the repository at this point in the history
  • Loading branch information
sysbird committed Mar 28, 2024
1 parent 4e98043 commit 5e10613
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/blocks/button/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class VKBButton extends Component {
const iconSizeAfter = this.props.lbIconSizeAfter;
const richText = this.props.lbRichtext;
const subCaption = this.props.lbsubCaption;
const isSelected = this.props.isSelected;
let aClass = '';
let aStyle = {};
let iconBefore = '';
Expand Down Expand Up @@ -76,6 +77,18 @@ export class VKBButton extends Component {
}
}

// 文字色がカスタムカラーの場合
if (
buttonTextColorCustom !== undefined &&
isHexColor(buttonTextColorCustom) &&
isSelected
) {
aStyle = {
// 編集画面対策
color: `${buttonTextColorCustom}`,
};
}

aClass = `${aClass} btn-${buttonSize}`;

if (buttonAlign === 'block') {
Expand Down
1 change: 1 addition & 0 deletions src/blocks/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ export default function ButtonEdit(props) {
lbIconSizeBefore={iconSizeBefore}
lbIconSizeAfter={iconSizeAfter}
lbsubCaption={subCaption}
isSelected={true}
lbRichtext={
<RichText
tagName={'span'}
Expand Down

0 comments on commit 5e10613

Please sign in to comment.