Hi

Great module but there is a problem in that if you have set a width attribute in css for your input field (the only way to get the same width in IE & Firefox) then it is ignored for the size of the placeholder. This causes the size to appear to toggle depending whether the field has the focus.

The attached patch file fixes this and also sets the placeholder text to grey - a much better appearance.

CommentFileSizeAuthor
hint6.x-1.2+color+width.patch640 bytesTracy Dean

Comments

quicksketch’s picture

Hard-coding the width sounds like a good idea, but the color should not be hard-coded since it would be impossible to change through CSS. You should just put a color for the hint in your own style.css file:

input.hint {
color: #999;
}

Note that hint *does* copy over all the CSS classes, so if you target the textfield based on the parent wrapper DIV then the width will be maintained. The only situation in which it does not work is when you target an element by it'd ID, since the ID is not copied to the placeholder element, as this could cause all sorts of JS problems with two elements on the page having the same ID.

Tracy Dean’s picture

Thanks for the quick response.

You're quite right, I was using the ID for the width css - I've now changed that. And I hadn't spotted that the 'hint' class was being added to make it themeable.

Sorted now, many thanks again.

rsvelko’s picture

won't fix or fixed?

quicksketch’s picture

Category: bug » support
Status: Active » Fixed

Let's mark as fixed, since I don't think we'll be changing this behavior. A class is already added and the non-copy of the element ID is intentional.

Status: Fixed » Closed (fixed)
Issue tags: -placeholder width color

Automatically closed -- issue fixed for 2 weeks with no activity.