Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Element#setStyle improvement: Assume Number values as px

#164

This sets the height of the element to '123px', as expected:

element.setStyle('height', '123px');
But this doesn't, as value is a Number, where element.style only recognizes Strings:
element.setStyle('height', 123);
Why not automagically change value to value + 'px' when isNumber(value), as this is what the user intended in 99% of the time?

Reported by Douwe M. · January 7th, 2010 @ 07:19 PM

State: invalid
Milestone: none
Assigned to: nobody

Activity

  1. MadRabbit
    MadRabbit
    • State changed from new to invalid

    Although I agreed that sometimes it is kinda pain the ass, but it's better the developer will run into the limitation during the development time and define things clearly, rather than wonder wtf in debugging.

    And there is nothing more frustrating than spending time debugging some smartass features.

    Sorry, no go.

    January 8th, 2010 @ 01:13 PM

  2. Douwe M.
    Douwe M.

    Okay, I get it. Np :-)

    January 8th, 2010 @ 08:12 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.