Change the blocks max width.

165 views
Skip to first unread message

Donnie Y

unread,
Apr 14, 2023, 4:14:04 AM4/14/23
to Blockly
Hi,

I am trying to make a stetement block with a shadow block as an arg.
And this arg block will show a message telling a user what kind of block can replace.

I am having issue that if the message is too long, instead of enlarging the width of the block, but it ellipsis the message in certain width.
It seems like there is a max width value.

block_with_max_width.png

I would like to change this max width value of a certain block or all the other blocks at the same time.

Does anyone knows how to achieve this??

Thanks,
Donnie

Neil Fraser

unread,
Apr 14, 2023, 5:08:19 AM4/14/23
to blo...@googlegroups.com
The max width for a field is set here:

This makes sense for user-input fields.  However, I'd argue that it does not make sense
for non-editable text labels.  I'll create a pull request to increase this limit to Infinity for text labels.

Demo:
Screenshot 2023-04-14 at 11.06.50.png

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/89193cc5-8013-498b-9159-28e4c7426c57n%40googlegroups.com.


--
Neil Fraser, Switzerland
https://neil.fraser.name

Donnie Y

unread,
Apr 18, 2023, 3:33:14 AM4/18/23
to Blockly
Thank you for letting me know of the source location.

According to the comment in field.d.js file, it tells to update FieldImage.prototype to change the default value.
I tried to figure out of the way to do so, but instead i used a "input_dummy" to make the sentence with multiple line.

Still I will try to update the default value in Field.
If I succeed in doing so, i will add a comment here.

Thanks again for the help, Neil.

2023년 4월 14일 금요일 오후 6시 8분 19초 UTC+9에 Neil Fraser님이 작성:

Neil Fraser

unread,
Apr 18, 2023, 8:33:18 AM4/18/23
to blo...@googlegroups.com
Here is the pull request that got merged and will be in the next version:
https://github.com/google/blockly/pull/6979

Sent (awkwardly) from an Android device.

Reply all
Reply to author
Forward
0 new messages