question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Block html not logically ordered

See original GitHub issue

Expected Behavior

Block html should be ordered in a logical and “readable” manner

(This is a crude interpretation of the suggested structure, purely for demonstration)

<block>
    <text>set</text>
    <variable>variable</variable>
    <text>to</text>
    <child>
        <input>480<input>
        <text>/</text> 
        <input>256</input>
    </child>
    <block-stack>
        ...
    </block-stack>
</block>

Logical organization following the rendering image

Actual Behavior

(again a crude interpretation of the actual structure, purely for demonstration)

<block>
    <child>
        <input>480<input>
        <input>256</input>
        <text>/</text>
    </child>
    <block-stack>
        ...
    </block-stack>
    <text>set</text>
    <variable>variable</variable>
    <text>to</text>
</block>

Here is that same structure, if it actually was reflected in the block rendering image

Steps to Reproduce

Inspect the html of any blocks/stack in the editor

Operating System and Browser

Windows NT 10.0, Chrome 86.0.4240.111

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
BryceLTaylorcommented, Oct 29, 2020

This is by design. The rendering of the blocks is independent of the html representation.

0reactions
kchadhacommented, Nov 5, 2020

The block xml is supposed to be agnostic of how the block is laid out. In particular, something that is not reflected in this issue description is that the block XML has named inputs. These are important for being able to layout the block inputs in different orders (e.g. in different languages) while keeping the block XML exactly the same regardless of which language the block is rendered in.

For example here is the same block in English vs. Japanese, notice that the text and inputs are in different orders:

image

image

Some languages will have even more of a drastic difference than this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Switching the order of block elements with CSS - Stack Overflow
Here is a "simple as possible" example, for changing the order of div-elements (when resizing the browser window): <!DOCTYPE html> <html> ...
Read more >
order - CSS: Cascading Style Sheets - MDN Web Docs
The order CSS property sets the order to lay out an item in a flex or grid container. Items in a container are...
Read more >
New CSS Logical Properties! - Elad Shechter - Medium
The way of thinking in CSS Logical Properties​​ Before you start using the new logical properties, you need to stop thinking in terms...
Read more >
Structural markup and right-to-left text in HTML - W3C
The solution is to use 'logical properties' when setting up your style: ie. use 'start' and 'end', rather than 'left' or 'right'. Using...
Read more >
Policy evaluation logic - AWS Identity and Access Management
This step is not necessary for a few services, such as Amazon S3, that allow some ... Resource data – Data related to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found