A Little Bug at WordPress

I’m developing a theme for wordpress now. The theme use the javascript color picker, like the WordPress default theme, Kubrick. There’s a button that will be the anchor for the Color Picker when it’s shown. I’m using DIV-type color picker, not the Window-type one, which means that the color picker is shown at a DIV element, not a new pop-up window. So much like Kubrick.

When I tried it up in Firefox, the color picker DIV is not shown up right under the button. The Error Console said that “error in parsing value top, bla bla bla”, means that the top property for the color picker DIV has a wrong value. FYI at Opera, that error doesn’t occur.

Wordpress Color Picker Bug

And then I try to take a look at the javascript file, colorpicker.js which is located inside wp-include/js directory. After some times, I found something missed at the function PopupWindow_showPopup that manages how will the DIV be shown.

At line 295, it said:

document.getElementById(this.divName).style.top = this.y;

See? The command to set the “top” property is incomplete. At Firefox, it needs a “px” if you want to change a size or dimension of an element. After I put the “px”, it works fine.

But of course, that’s not a suitable solution since I’ll release this theme, so the user of this theme (I hope there will be some users :D ) will have to change that file too. Fortunately, I can override that function. Owkey, but that makes my script seems so long. :(

Actually, I’d like to report this little bug to WordPress team, but I find that’s not easy, so much things to do, instead of just send email to Matt and say “Hi, Matt, I found a bug at WordPress here, maybe you can fix it.” So I changed my mind at write it out here. And hopefully they will read this. :P

Oh, yes… the post above is written in English. Bad grammar or tenses? ^:)^

11 thoughts on “A Little Bug at WordPress”

Leave a Reply