Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui-a11y-utils): fix regression in focus region #1375

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

balzss
Copy link
Contributor

@balzss balzss commented Nov 22, 2023

this was fixed in #1332 and reappeared in #1371

this should be a more sufficient solution

test plan

  • open the docs app at the modal example
  • use this code:
<div style={{ padding: '0 0 11rem 0', margin: '0 auto' }}>
        <Button onClick={this.handleButtonClick}>
          {this.state.open ? 'Close' : 'Open'} the Modal
        </Button>
        <Modal
          as="form"
          open={this.state.open}
          onDismiss={() => { this.setState({ open: false }) }}
          onSubmit={this.handleFormSubmit}
          size="auto"
          label="Modal Dialog: Hello World"
          shouldCloseOnDocumentClick
        >
          <Modal.Header>
            {this.renderCloseButton()}
            <Heading>Hello World</Heading>
          </Modal.Header>
          <Modal.Body>
            <TextInput renderLabel="Example" placeholder="if you hit enter here, it should submit the form" />
            <Text lineHeight="double">{fpo}</Text>
            <Checkbox label={lorem.sentence()} value="medium" defaultChecked />
          </Modal.Body>
          <Modal.Footer>
            <Button onClick={this.handleButtonClick} margin="0 x-small 0 0">Close</Button>
            <Button color="primary" type="submit">Submit</Button>
          </Modal.Footer>
        </Modal>
      </div>
  • open the modal
  • press tabs until the focus is on the checkbox
  • press space
  • the modal shouldn't close

@balzss balzss self-assigned this Nov 22, 2023
Copy link

Preview URL: https://1375--preview-instui.netlify.app

@balzss balzss merged commit 43dc1d8 into master Nov 23, 2023
4 checks passed
@balzss balzss deleted the fix/focusregion-click-event branch November 23, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants