Skip to content

Commit

Permalink
Fix setting border radius on web in singleline mode (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid authored Feb 17, 2025
1 parent 958dbd9 commit 0e8cf49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/MarkdownTextInputDecoratorViewNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ interface MarkdownStyle {
mentionHere: {
color: ColorValue;
backgroundColor: ColorValue;
borderRadius?: Float;
};
mentionUser: {
color: ColorValue;
backgroundColor: ColorValue;
borderRadius?: Float;
};
mentionReport: {
color: ColorValue;
backgroundColor: ColorValue;
borderRadius?: Float;
};
inlineImage: {
minWidth: Float;
Expand Down
8 changes: 5 additions & 3 deletions src/web/utils/blockUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ function addStyleToBlock(targetElement: HTMLElement, type: NodeType, markdownSty
});
break;
case 'text':
if (!isMultiline) {
Object.assign(node.style, {backgroundColor: targetElement.parentElement?.style.backgroundColor});
Object.assign(targetElement.parentElement?.style ?? {}, {backgroundColor: 'transparent'});
if (!isMultiline && targetElement.parentElement?.style) {
// Move text background styles from parent to the text node
const parentElement = targetElement.parentElement;
node.style.cssText = parentElement.style.cssText;
parentElement.style.cssText = '';
}
break;
default:
Expand Down

0 comments on commit 0e8cf49

Please sign in to comment.