react / react/yoga

Failed to execute "setPosition": Unsupported unit 'auto'

Open
#750 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

JavaScript
Dominant language
C++
Stars
18.9k
Forks
1.6k
Avg merge
1m
Merged PRs (30d)
1

Description

Report

Issues and Steps to Reproduce

There is no way to unset position (in the JavaScript version 1.9.3) because setPositionAuto is not a function even though it is being patched to support 'auto' as a value:

https://github.com/facebook/yoga/blob/master/javascript/sources/entry-common.js#L242

Expected Behavior

I expect to be able to call setPosition(EDGE_TOP, 'auto') or setPositionAuto(EDGE_TOP)

Actual Behavior

Error: Failed to execute "setPosition": Unsupported unit 'auto'

Link to Code

If you have some code that maintainers can clone/test for themselves, bugs can be resolved much faster. Please paste a link here.

When applicable, use this fiddle to post a web repro.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in javascript/sources/entry-common.js around line 242, where support for the 'auto' value is patched. Reproduce the issue with the JavaScript API using setPosition(EDGE_TOP, 'auto') and check whether setPositionAuto is available. Done means either call accepts 'auto' or the corresponding setPositionAuto API works without the unsupported-unit error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.