-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I use zk 8.6 with this custom mold for checkbox:
<checkbox checked="@bind(value)" onCheck="@command(updateCommand)" label="@load(label)" mold="formgroup"/>
function (out) {
var uuid = this.uuid, content = this.domContent_();
out.push('<label', this.domAttrs_(), ' for="', uuid,'-real">',
'<input type="checkbox" id="', uuid, '-real"', this.contentAttrs_(), '/>',
content,'</label>');
}
After upgrade to 9.6.4 I get an error an global error : "error code 3 zk error after mounting" In the javascript console I see :
za11y.wpd:4 Uncaught TypeError: Cannot read properties of null (reading 'getAttribute')
at r.bind_ (za11y.wpd:4:677)
at r.bindChildren_ (zk.wpd:21:27149)
at r.bind_ (zk.wpd:21:26711)
at r.bindChildren_ (zk.wpd:21:27149)
at r.bind_ (zk.wpd:21:26711)
at r.bindChildren_ (zk.wpd:21:27149)
at r.bind_ (zk.wpd:21:26711)
at r.bindChildren_ (zk.wpd:21:27149)
at r.bind_ (zk.wpd:21:26711)
at r.bindChildren_ (zk.wpd:21:27149)
Can anyone help me ?
Hey there,
With the za11y library enabled (which adds wcag / aria attributes to the page), the checkbox will try the following logic to find the main node for za11y purposes:
getA11yRealNode_: function () {
return this.$n((this._isDefaultMold() || this._isTristateMold()) ? 'real' : 'mold');
That means that in default mold or in tristate mold, it will attempt to find the node with uuid-real ID inside of the checkbox Otherwise, it will attempt to locate the node with "uuid-mold" id.
based on your mold, it appear that you have a mold entry, so it will attempt to locate the "uuid-mold" node.
However, your mold doesn't have such node (it has a -real node).
You can try renaming the -real to -mold (and relevant links in the label)
'<input type="checkbox" id="', uuid, '-mold"', this.contentAttrs_(), '/>'
Try if that works.
If it doesn't, you may need to override the getA11yRealNode_ on the checkbox to point to your actual node.
Asked: 2023-07-07 22:05:33 +0800
Seen: 6 times
Last updated: Jul 11
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver