-
Notifications
You must be signed in to change notification settings - Fork 328
Open
Labels
Description
Describe the bug
We would like to integrate autocomplete field in OKTA widget.
To do this we need to add autocomplete="one-time-code" attribute to HTML input.
Currently we use classicEngine (config.useClassicEngine = true;) widget and I couldn't make it work.
I was trying to play with feature: features.disableAutocomplete.
Also I was trying to add hook to afterRender via code:
const oktaSignIn = new OktaSignIn(config);
oktaSignIn.on('afterRender', afterRender);
oktaSignIn.on('afterError', redirectToLoginPage);
function afterRender() {
const otpInput = document.querySelector('.o-form-input-name-answer > input');
if (otpInput) {
otpInput.setAttribute('autocomplete', 'one-time-code');
}
}
Unfortunately above solutions doesn't seem to work.
afterRender - solution seems to work (not override) for totp app, but for sms it setsautocomplete="off" - my assumption is that react for some reason recreates input element.
Reproduction Steps
Set afterRenderer function to override attribute autocomplete.
SDK Versions
7.12.2
Additional Information
No response