remove readonly attr once element is ready for input (#31502)

This commit is contained in:
lane-wetmore 2025-08-15 11:47:37 -05:00 committed by GitHub
parent b5b4a95280
commit 04295060d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,9 +165,13 @@ export default class SwaggerUiComponent extends Component {
}
updateDisabledFields() {
document.querySelectorAll('.parameters :disabled').forEach((el) => {
el.removeAttribute('disabled');
el.setAttribute('readonly', true);
document.querySelectorAll('.parameters').forEach((el) => {
if (!el.disabled) {
el.removeAttribute('readonly');
} else {
el.removeAttribute('disabled');
el.setAttribute('readonly', true);
}
});
}