You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the onChange is not firering if I remove the select initialisation M.FormSelect.init(node,{}), the event is triggered on default select, that worked before the alpha release
Expected behavior
the onChange should trigger by default
Possible Solutions or Causes
Maybe an evt.stopPropagation on bad state or preventDefault
Steps to reproduce
Just try trigger onChange event on select in react
Your Environment
Version used: latest
Browser Name and version: firefox latest
Operating System and version (desktop or mobile): ubuntu latest
Additional information you want to tell us:
The text was updated successfully, but these errors were encountered:
I found the bug so its at this line if (selectionHasChanged) this.el.dispatchEvent(new Event('change'));
line 163 of select.ts you need to add option to event to allow propagation , because react overload default onchange with onChange function on his core and with your dispatchEvent you prevent this so the right way should be if (selectionHasChanged) this.el.dispatchEvent(new Event('change'),{bubbles: true});
I will try to make a fix of all events of all composents if your are agree? because for now materialize is unusable to front framework like react and emberjs for example
I'll like to fix that soon of possible cause it block me for work. ty
InitialCrow
added a commit
to InitialCrow/materialize
that referenced
this issue
Jul 18, 2023
… with framework (e.g react)
Actualy materialize is broken on react and ember js due to non propageable event for e.g react
overload default onchange event with onChange custom event since alpha release materialize not fired
event due to non propageable event on components
fixmaterializecss#398
Before submitting...
Context
Hello again,
I have that select in react since alpha release I cant trigger onChange event in react on change work on html but not work anymore on react
Current Behavior
I have that select
the onChange is not firering if I remove the select initialisation M.FormSelect.init(node,{}), the event is triggered on default select, that worked before the alpha release
Expected behavior
the onChange should trigger by default
Possible Solutions or Causes
Maybe an evt.stopPropagation on bad state or preventDefault
Steps to reproduce
Just try trigger onChange event on select in react
Your Environment
The text was updated successfully, but these errors were encountered: