Blockly Field Text Area Box is visible in the other tabs

118 views
Skip to first unread message

Aparna Gk

unread,
Feb 1, 2022, 2:58:15 AM2/1/22
to Blockly
Hi Team,

When we have a multiple tabs in the design and one of them is a blockly tab , operations performed under the blockly tab by adding the text in blockly text field would be seen when we switch to the different tabs immediately after editing the text.

1)inside the blockly tab
Capture2.JPG
2)when moving to other tab immediately after editing in blockly text filed 
Capture3.JPG


Text entered in blockly text box shouldn't be seen when the immediate switch to other tabs is done.
Any suggestions how could this issue be resolved?


Thanks,
Aparna

Maribeth Bottorff

unread,
Feb 1, 2022, 8:47:21 PM2/1/22
to Blockly
Hello,

I believe you need to call `Blockly.hideChaff()` when the user switches tabs in your application: https://github.com/google/blockly/issues/2066#issuecomment-507423263

hideChaff closes various things such as the toolbox flyout, the widgetDiv (which is what holds the textinput you're seeing), etc 

Hope that helps,

Maribeth

Aparna Gk

unread,
Feb 2, 2022, 3:16:43 AM2/2/22
to blo...@googlegroups.com
Hi  Maribeth,

This worked, Thank you!

Is there any way to restrict the user from writing value into a textbox(do not allow the person to enter text on the text box)?
image.png

Thanks is Advance 

Aparna
 

--
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/021a3f4f-ffa8-4113-ab4a-91437958fc2dn%40googlegroups.com.

Maribeth Bottorff

unread,
Feb 2, 2022, 8:43:57 PM2/2/22
to Blockly
Hello,

You can also use the "label" field instead of the "text input" field if this is something that a user should never be able to type into.

Aparna Gk

unread,
Feb 3, 2022, 1:11:52 AM2/3/22
to Blockly
Hi,

I tried using "blocklyNamespace.CustomFields.HierarchicalDropDown.prototype.EDITABLE = false;" still i can perform edit operations in the field Textbox.

Capture22.JPG

Is there anyway to resolve issue?(possibly by removing the cursor position?)
Could you be more specific how could be use "label".
Thanks is Advance.

Thanks
Aparna 

Maribeth Bottorff

unread,
Feb 3, 2022, 4:00:58 PM2/3/22
to Blockly
I think the fundamental problem here is that you're extending from the "TextInput" field but it seems like you don't actually want the user to be able to type into the field, so a text input field might not actually be the best choice for you. The "label" field is just text, but then you'd have to figure out how to signal to the user to click there to begin editing, so I guess that's just a different problem... When I wrote my previous response I wasn't looking at your screenshot with the dropdown ux.

The simplest solution I can think of to use what you've currently got is to override the `widgetCreate_` method (in your subclass of FieldTextInput), call the super method (which returns the html element where it added the text input), and then add the "readonly" attribute to the input.

Maribeth

Reply all
Reply to author
Forward
0 new messages