Description
When targeting wasm32-unknown-unknown, placing a row![] with multiple text() widgets inside a button() causes the text content to be clipped to a single character. This does not occur on native (Linux/Vulkan).
Reproduction
// BROKEN on WASM — shows "I" instead of "Import"
button(
row![
text(icon_char).font(icon_font).size(16),
text("Import").size(13),
]
.spacing(6)
.align_y(Alignment::Center)
)
.padding([6, 12])
.width(Length::Fill)
.style(primary_button_style)
// WORKS on WASM — shows full "Import"
button(
text("Import").size(13).center()
)
.padding([6, 12])
.width(Length::Fill)
.style(primary_button_style)
Observations
- Single
text() inside button() renders correctly on WASM
row![] inside button() causes text to clip to 1 character on WASM
- Same code renders correctly on native (Linux, Vulkan backend)
.width(Length::Fill) on the button may be a contributing factor, but removing it still shows the clipping when row![] is present
text() with explicit .font() is not the cause — tested with default font and explicit font, both clip inside row![]
row![] outside of button() (e.g., in a container) renders text correctly
Environment
- iced 0.14
- Target:
wasm32-unknown-unknown
- Built with trunk 0.21.14
- Browser: Chrome (WebGPU enabled)
- Works correctly on: Linux native (Vulkan)
Workaround
Use a single text() widget inside button() instead of row![]. For buttons that need an icon + label, either concatenate them in one string or place them outside the button.
Description
When targeting
wasm32-unknown-unknown, placing arow![]with multipletext()widgets inside abutton()causes the text content to be clipped to a single character. This does not occur on native (Linux/Vulkan).Reproduction
Observations
text()insidebutton()renders correctly on WASMrow![]insidebutton()causes text to clip to 1 character on WASM.width(Length::Fill)on the button may be a contributing factor, but removing it still shows the clipping whenrow![]is presenttext()with explicit.font()is not the cause — tested with default font and explicit font, both clip insiderow![]row![]outside ofbutton()(e.g., in acontainer) renders text correctlyEnvironment
wasm32-unknown-unknownWorkaround
Use a single
text()widget insidebutton()instead ofrow![]. For buttons that need an icon + label, either concatenate them in one string or place them outside the button.