Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BUG: Dynamically set negative position values raise an exception

ANSWERED

Since there doesn't seem to be any support for horizontal scrolling or pagination, I've been trying to implement the functionality myself, but I get this exception when I try to dynamically set an element's position to a negative value: "Argument at index 0 is invalid: Value out of bounds for native type"

 

Example:

 

<!-- resources/index.gui -->
<svg>
<text id="foo">whatever</text>
</svg>
// app/index.js
import document from 'document'; let el = document.getElementById('foo'); el.x = 50; // OK el.x = -50; // Exception: Argument at index 0 is invalid: Value out of bounds for native type

The same exception occurs when trying to negatively position along the y axis.

 

Static negative positioning works fine, though:

<svg>
<text x="-50">whatever</text>
</svg>

 

 

Best Answer
1 BEST ANSWER

Accepted Solutions

Does this error also get thrown when performing a translation?  Rather than setting it offscreen, have you tried using min-x and using a transform to pull it on screen?

View best answer in original post

Best Answer
3 REPLIES 3

Does this error also get thrown when performing a translation?  Rather than setting it offscreen, have you tried using min-x and using a transform to pull it on screen?

Best Answer

We're also working on correctly supporting the various types of values. 100%, -10, $-10 etc.

Best Answer

Thanks for the idea. I ended up dynamically triggering an <animate> element for the movable content, and it works great. The issue I raised is still a bug, but this is a good workaround that also happens to be the best solution for my particular use case.

Best Answer