Merge pull request #767 from DioxusLabs/jk/fix-listener-indx
This commit is contained in:
1 file changed
+4
-3
@@ -394,9 +394,10 @@ impl VirtualDom {
|
|||||||
for (idx, attr) in template.dynamic_attrs.iter().enumerate() {
|
for (idx, attr) in template.dynamic_attrs.iter().enumerate() {
|
||||||
let this_path = node_template.attr_paths[idx];
|
let this_path = node_template.attr_paths[idx];
|
||||||
|
|
||||||
// listeners are required to be prefixed with "on", but they come back to the virtualdom with that missing
|
// Remove the "on" prefix if it exists, TODO, we should remove this and settle on one
|
||||||
// we should fix this so that we look for "onclick" instead of "click"
|
if attr.name.trim_start_matches("on") == name
|
||||||
if &attr.name[2..] == name && target_path.is_ascendant(&this_path) {
|
&& target_path.is_ascendant(&this_path)
|
||||||
|
{
|
||||||
listeners.push(&attr.value);
|
listeners.push(&attr.value);
|
||||||
|
|
||||||
// Break if the event doesn't bubble anyways
|
// Break if the event doesn't bubble anyways
|
||||||
|
|||||||
Reference in new issue
Block a user