The "max_lines
" field in multi-line input in Dialog limits how many lines visually instead of how many \n
there are (of how many return you can hit).
This causes the width of the input box actually limits how many characters can be input. If we set max_lines
to be 1, then after the curser reaches the end of the line then we can no longer write new characters despite the max_length
is set very high, since the word does not wrap and it does not scroll horizontally.
To Reproduce:
Run this command in Minecraft 1.21.6:
dialog show @s {type:"notice",title:"Bug Test",inputs:[{key:"test",type:"text",label:"test",initial:"",max_length:999999999,multiline:{height:50,max_lines:1},width:300}]}
We opened a dialog window that accepts text input. Max characters is set to 999999999
, but max_lines
is set to 1.
Then keep inputting text, for example, keep pressing d.
What is Expected:
After letter d fills the first line, it warps to the next line and continue inputting, or the box a least scrolls horizontally to allow more d getting inputted, until max_length
is reached (999999999
in this case) .
What Actually Happened:
The d stops at the end of the first line.
Attachments
Comments 2
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support (Technical Issues) β π§ Microsoft Support (Account Issues)
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki
Can confirm, but more likely than not this is intended. The 25w21a changelog says that
multiline
βallows users to input multiple linesβ, which could refer either to return characters or to visible lines, but then later on it states that ifheight
is omitted and βmax_lines
is present, the height will be chosen to fit the maximum number of linesβ, suggesting thatmax_lines
refers only to visible lines. As far as use cases go, there are some cases where it would be desired to limit the number of return characters the player can type, but in other cases the dialog creator might want to have a multi-line text field where the user is not allowed to type anything that would create a scroll bar, and the current behavior makes this fairly straightforward to do. So if this is a valid bug, perhaps the best way to fix it would be to have two fields,max_visible_lines
andmax_newlines
.