Skip to content

Commit c1a3895

Browse files
JustinCCYapclaude
andcommitted
RS-21330: Make label measurement div resilient to body CSS changes
Use position:fixed;width:max-content instead of display:inline-block so the measurement div is unaffected by flex/grid parent layouts (e.g. the new UI sets body to display:flex) and immune to global width rules that could skew the measured label dimensions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c7b990e commit c1a3895

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

inst/htmlwidgets/rhtmlPictographs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/htmlwidgets/rhtmlPictographs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

theSrc/scripts/utils/labelUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
const textDivsForEstimation = _(labels)
4646
.map(ensureFontSizeHasPx)
4747
.map(makeDivForEstimation).value()
48-
const divWrapper = $(`<div id="${uniqueId}" style="display:inline-block;position:fixed;visibility:hidden">`)
48+
const divWrapper = $(`<div id="${uniqueId}" style="position:fixed;visibility:hidden;width:max-content">`)
4949

5050
divWrapper.html(textDivsForEstimation)
5151
$(document.body).append(divWrapper)

0 commit comments

Comments
 (0)