Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style attribute object and lengths not handled properly #648

Closed
ghost opened this issue Apr 2, 2017 · 5 comments
Closed

Style attribute object and lengths not handled properly #648

ghost opened this issue Apr 2, 2017 · 5 comments
Assignees
Labels
good first issue Small tasks that would be good for first time contributors reason-closed:resolved The question was answered, the bug was fixed, or the feature was implemented type:bug A bug report

Comments

@ghost
Copy link

ghost commented Apr 2, 2017

Hello

Bug Report

I was moving a div around the page with the mouse, then I got a weird behavior. I'm quite new with all this stuff but it looks like a bug.

Context

Marko template:
div style={position:'absolute',top:0} -- test
Rendering:
var bloc = require('./bloc');
bloc.renderSync().appendTo(document.body);

Expected Behavior

'top' property should be set to zero and the text should be displayed at the top of the page.

Actual Behavior

The value 0 for 'top' is ignored and the 'top' property is not set in the style (according to FF inspector). The text is displayed at the default position that depends on previous elements in body.

  • No error message.
  • Negative values are accepted and the position of the div is correct
  • Same problem with 'left' property (not tested with other ones)
  • Same problem when state is changed with code
Additional Info

Your Environment

  • Version used: marko 4.2.0
  • Environment name and version: node.js 6.10.0-win-x64 Firefox 52.0.2
  • Operating System and version: Windows 10 desktop
@patrick-steele-idem patrick-steele-idem added the type:bug A bug report label Apr 2, 2017
@patrick-steele-idem
Copy link
Contributor

That does indeed look like a bug. I'll investigate.

@patrick-steele-idem patrick-steele-idem added the good first issue Small tasks that would be good for first time contributors label Apr 2, 2017
@patrick-steele-idem
Copy link
Contributor

The following line looks like the problem:

If value === 0 then the if condition will not evaluate. Interested in submitting a Pull Request to fix the problem?

@patrick-steele-idem
Copy link
Contributor

Actually, I'm going to go ahead and take this one. There are some other changes that I think need to be made.

@patrick-steele-idem patrick-steele-idem self-assigned this Apr 2, 2017
@patrick-steele-idem patrick-steele-idem changed the title 'style.top' or 'style.left' cannot be zero Style attribute object and lengths not handled properly Apr 2, 2017
@patrick-steele-idem
Copy link
Contributor

New version published with fix: marko@4.2.2

Thanks for reporting the problem!

@patrick-steele-idem patrick-steele-idem added the reason-closed:resolved The question was answered, the bug was fixed, or the feature was implemented label Apr 2, 2017
@ghost
Copy link
Author

ghost commented Apr 2, 2017

I surely could not have be so quick. I don't even know how I can test modified code… I may be more helpful in some days/weeks.
Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Small tasks that would be good for first time contributors reason-closed:resolved The question was answered, the bug was fixed, or the feature was implemented type:bug A bug report
Projects
None yet
Development

No branches or pull requests

1 participant