Skip to content

[BUG] Rects do not accept string formatted numbers without units (e.g. "42")for x and y parameters. #3086

@jdthorpe

Description

@jdthorpe

1. Read the FAQs 👇

2. Describe the bug

If either of the x or y attributes of a <rect>'s animate parameter is a string without units (like "42") then neither x or y position is included in the DOM.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

See This Sandbox
4. Steps to reproduce

Steps to reproduce the behavior:

Open the sandbox, and notice that the 3 rects are not staggered. The x value is a string formatted number ("15") and the y value is a number (15). To get this to work correctly, convert the x value to either a number (15) or add units to the string (e.g. "15px")

5. Expected behavior

The x and y parameters of an SVG <rect> should accept string numbers without units.

6. Video or screenshots

See the sandbox example

7. Environment details

Chrome and Edge for Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions