I was recently astonished to discover that the Label widget gets a 'div' element, not a 'label' element. This bit me while doing accessibility testing for my app -- screen readers expect all form fields, inputs etc. to have labels. I was using Label widgets for that, so I was puzzled when accessibility tools like the Firefox "WAVE" plugin did not find the labels ... then I noticed that the Label widgets all had <div> elements, not <label> elements -- arg.
So my next move was to hack the Label.py code, changing its DOM.createDiv() to DOM.createLabel(). That fixed the labels but caused a whole slew of other messages ... hmm, turns out that the HTML widget inherits from the Label widget ... wtf?? I guess there must be some weird, counter-intuitive historical reasons (maybe GWT does that?). So not wanting to do *too* much hacking, I replaced all my app's HTML widgets with HTMLPanel widgets (which do *not* inherit from Label), which makes them heavier than they need to be (they don't really need to be Panels). If anyone cares and understands what the consequences would be (e.g. other breakage), I'd suggest switching the positions of Label and HTML in the pyjamas.ui widget tree -- shouldn't Label be *more* specific than HTML? (And let HTML inherit from MouseHandler and ClickHandler, as Label currently does.) Steve -- --- You received this message because you are subscribed to the Google Groups "Pyjs.org Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyjs-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.