google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.37k stars 3.69k forks source link

Expose `bringToFront()` method #8233

Closed JonasFocke01 closed 1 month ago

JonasFocke01 commented 2 months ago

Check for duplicates

Problem

Hi, I have the problem, that i have a fixed top level block in my szenario. It can happen now, that a block by accident gets obershadowed by this, making it unpossible to fix this sittuation by the user.

Request

I would love a way to bring all parentless blocks to the front by calling something like bringToFront() on it. I know, that this method exists internally, i just could not find a way to call it from outside.

Alternatives considered

No response

Additional context

No response

cpcallen commented 2 months ago

Hello and thanks for this feature request.

Just out of interest, can you tell us what happened when you attempted to call this method?

After discussing this request with a teammate we think it seems reasonable to remove the @internal tag from bringToFront, though the JSDoc for the method should be updated to note that reordering the DOM nodes (which is what this method does) might be expensive (i.e. slow) so it should perhaps be used sparingly.

We would welcome a PR from you that makes this change!

Spoorthy1423 commented 1 month ago

Hey!! @cpcallen i would love to work on this issue, please assign me

BeksOmega commented 1 month ago

Go for it @Spoorthy1423 =) let me know if you have any questions!

BeksOmega commented 1 month ago

This is being worked on by @UCYT5040