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

IE11 specific code in our Feedback component #4350

Open
AshGDS opened this issue Oct 30, 2024 · 0 comments
Open

IE11 specific code in our Feedback component #4350

AshGDS opened this issue Oct 30, 2024 · 0 comments

Comments

@AshGDS
Copy link
Contributor

AshGDS commented Oct 30, 2024

Our feedback component contains JavaScript specific to IE11, which isn't supported anymore. Therefore the code check isn't needed.

See the code here:

// much of the JS needed to support sending the form contents via this script is
// unsupported by IE, even IE11. This check causes IE to not intercept form submits
// and let them happen normally, which is handled already by the backend
if (typeof window.URLSearchParams === 'function') {
for (var f = 0; f < this.forms.length; f++) {
this.forms[f].addEventListener('submit', function (e) {
e.preventDefault()
var $form = e.target
var xhr = new XMLHttpRequest()
var url = $form.getAttribute('action')
var params = new FormData($form)
params = new URLSearchParams(params).toString()
this.done = function () {
if (xhr.status === 200) {
this.showFormSuccess(xhr.message)
this.revealInitialPrompt()
this.setInitialAriaAttributes()
this.activeForm.hidden = true
clearInterval(this.timerInterval)
} else {
this.showError(xhr)
this.enableSubmitFormButton($form)
}
}.bind(this)
xhr.addEventListener('loadend', this.done)
xhr.open('POST', url, true)
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
this.disableSubmitFormButton($form)
xhr.send(params)
}.bind(this))
}
}
}

Work would involve remove this code and associated tests, as well as removing the IE11 references in the feedback.yml description.

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

No branches or pull requests

1 participant