Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix formatting buttons in edition
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Nov 2, 2022
1 parent 479aa45 commit f1785e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ limitations under the License.
margin-right: 6px;
gap: 8px;

.mx_FormattingButtons {
margin-left: 12px;
}

.mx_WysiwygComposer_Editor {
border: 1px solid;
border-color: $quaternary-content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
.mx_FormattingButtons {
display: flex;
justify-content: flex-start;
gap: 8px;

.mx_FormattingButtons_Button {
--size: 28px;
Expand All @@ -26,18 +27,9 @@ limitations under the License.
line-height: var(--size);
width: auto;
padding-left: 22px;
margin-right: 8px;
background-color: transparent;
border: none;

&:first-child {
margin-left: 12px;
}

&:last-child {
margin-right: auto;
}

&::before {
content: '';
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
// Instead of doing a querySelector or pass a ref to find the compute the height formatting buttons
// We are using an arbitrary value, the formatting buttons height doesn't change during the lifecycle of the component
// It's easier to just use a constant here instead of an over-engineering way to find the height
const heightToRemove = hasFormattingButtons ? 45 : 0;
const heightToRemove = hasFormattingButtons ? 36 : 0;
const fixedRect = new DOMRect(
contentRect.x,
contentRect.y + heightToRemove,
Expand Down

0 comments on commit f1785e1

Please sign in to comment.