Skip to content

Commit

Permalink
[SME-980] Improve handling checkboxes (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-gruszka-tg authored Oct 11, 2024
1 parent 121d8c9 commit f309f66
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ui-kit/authenticators/UsernamePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ export default function UsernamePassword(props) {
})
}

const fields = actions[0]?.model?.fields;
if (fields && Array.isArray(fields)) {
fields.forEach(field => {
if (field.type === 'checkbox') {
if (!state.has(field.name)) {
state.set(field.name, 'off')
}
}
})
}

const computedTitle =
(messages && messages.find(m => m.classList.includes("heading"))?.text)
|| title
Expand Down

0 comments on commit f309f66

Please sign in to comment.