Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct typeof check for IE11 documentMode #1226

Merged
merged 3 commits into from Jul 8, 2020

Conversation

mblarsen
Copy link
Contributor

@mblarsen mblarsen commented Jul 6, 2020

Currently it does a string comparison which would always be false.

I.e. window.document.documentMode == 'undefined'.

It should be:

typeof window.document.documentMode == 'undefined' in order to use event.detail


I ran into this issue as my payload was sent back for syncInput with name set but value was always undefined. This is when using Apline's $dispatch('input', value').

I think it is a regression introduced from the autofill issue:

Commit: 15ac0ba
Author: Jason Mountcastle git@aspn.dev
Date: Tuesday, 30 June, 2020 01:15:34 AM PST

Currently it does a string comparison which would always be false.
@mblarsen
Copy link
Contributor Author

mblarsen commented Jul 7, 2020

Come to think about it. This bug must impact all non-native events emitted from non-input type elements.

@calebporzio
Copy link
Collaborator

Ooof, thanks so much!

@calebporzio calebporzio merged commit abca3b5 into livewire:1.x Jul 8, 2020
@mblarsen mblarsen deleted the bug/document-mode branch July 8, 2020 15:00
@eduarguz
Copy link

eduarguz commented Jul 31, 2020

Hi @mblarsen given you already addressed a related issue, could it be possible that other browsers have some similar issues?

I am debugging a similar problem in safari and someone reported the issue while using chrome

somewhere in js/node_initializer.js where you added the IE11 support

                // We have to check for typeof e.detail here for IE 11.
                const value =
                    e instanceof CustomEvent && typeof e.detail != 'undefined' && typeof window.document.documentMode == 'undefined'
                        ? e.detail
                        : el.valueFromInput(component)

I get that the e var is not a CustomEvent

image

Could you think what the issue is or guide me into how to fix it?


I am using this approach in my livewire/alpine component https://dev.to/eduarguz/adding-quilljs-editor-to-livewire-alpinejs-app-389l


Posted in
https://forum.laravel-livewire.com/t/issue-with-livewire-alpinejs-third-party-libraries/1373?u=eduarguz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants