mojira.dev
MC-306794

Dialog element's actual size does not match the content, but is forced to match width value

Description

When displaying a Dialog, body elements' content.width field (including the default/implicit 200 value) is now always displayed full-width and does not only specify the maximum width (where text is wrapped).

In particular, when viewing the white box surrounding the text (by pressing TAB or clicking on it), it always has the horizontal size of width, regardless of the content displayed.

Reproduce

This issue is best seen when looking at a body element of type minecraft:item; however, it exists also for minecraft:plain_message.

Simply execute this command:

/dialog show @s {type:"notice",title:"Title",body:[{type:plain_message,contents:"",width:100},{type:item,item:{id:"glass_pane"},description:{contents:"",width:100}}]}

1.21.10 (and expected) behaviour

Both text elements are empty, and therefore have minimum width; the glass pane is displayed (almost) center.

1.21.11 behaviour

Still, both texts are empty, however, they are rendered with a fixed width of 100. The glass pane is therefore pushed to the left.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media][media]

Trence

(Unassigned)

Unconfirmed

(Unassigned)

1.21.11

Retrieved