Skip to content

Commit

Permalink
revert Enketo buttons from <Button>s back to plain HTML
Browse files Browse the repository at this point in the history
Enketo requires there to be `<a>` elements with specific IDs for the "next" and "save" buttons.
We had nested `<Button>`s inside these to make them match the `<Button>`s we use elsewhere in the UI.
But in some webviews, the touch events would not bubble up from the `<Button>` to the `<a>` elements, causing the buttons to be unclickable except around the margins.

Reverting this back to just use plain `<a>` elements to resolve the bug.
Maybe revisit `<Button>` later because it was nicer looking.
  • Loading branch information
JGreenlee committed Mar 22, 2024
1 parent 78b5da1 commit 79250f7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions www/js/survey/enketo/EnketoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,20 @@ const EnketoModal = ({ surveyName, onResponseSaved, opts, ...rest }: Props) => {
</a>
<a
id="validate-form"
className="btn"
className="btn btn-primary"
onClick={() => validateAndSave()}
style={{ width: 200, margin: 'auto' }}>
<Button id="validate-form" icon="check-bold" mode="contained">
{t('survey.save')}
</Button>
{/* <Button icon="check-bold" mode="contained"> */}
{t('survey.save')}
{/* </Button> */}
</a>
<a href="#" className="btn next-page disabled" style={{ width: 200, margin: 'auto' }}>
<Button icon="arrow-right-thick" mode="contained">
{t('survey.next')}
</Button>
<a
href="#"
className="btn btn-primary next-page disabled"
style={{ width: 200, margin: 'auto' }}>
{/* <Button icon="arrow-right-thick" mode="contained"> */}
{t('survey.next')}
{/* </Button> */}
</a>
<div className="enketo-power" style={{ marginBottom: 30 }}>
<span>{t('survey.powered-by')}</span>{' '}
Expand Down

0 comments on commit 79250f7

Please sign in to comment.