Skip to content

Commit

Permalink
fix(Ellipsis): middle mode has more characters on right than on left (#…
Browse files Browse the repository at this point in the history
…5253)

fix(Ellipsis): middle mode has more characters on the right than on the left
  • Loading branch information
mraiguo committed May 30, 2022
1 parent 15a1d09 commit b07d5e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ellipsis/ellipsis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const Ellipsis: FC<EllipsisProps> = p => {
}
}
const leftPartMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2)
const rightPartMiddle = Math.floor((rightPart[0] + rightPart[1]) / 2)
const rightPartMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2)
container.innerText =
props.content.slice(0, leftPartMiddle) +
'...' +
Expand Down

0 comments on commit b07d5e6

Please sign in to comment.