In my litElement render I have radio buttons styled as regular buttons for answering a question, like so:
<h4>Did you take a shower today?</h4>
<div>
<input type="radio" hidden id="tookShower1" name="tookShower" .checked=${!!answeredAffirmative} value="yes"/>
<label for="tookShower1" class="answerbutton" @click='${() => this._handleAnswerQuestion('yes')}' tabindex="0">
<div>Yes</div>
</label>
</div>
<div>
<input type="radio" hidden id="tookShower2" name="tookShower" .checked=${!!answeredNegative} value="no" />
<label for="tookShower2" class="answerbutton" @click='${() => this._handleAnswerQuestion('no')}' tabindex="0">
<div>No</div>
</label>
</div>
I need them to be fully functional as buttons for keyboard only. Obviously adding tabindex to the label is a start, but how can I add the same behaviour triggered by a click (i.e. this._handleAnswerQuestion('yes') etc) when the label (presumably) is focused and Enter is pressed?