Skip to content

Commit

Permalink
fix: set focus properties so textfield maintains focus when popover o…
Browse files Browse the repository at this point in the history
…pens (#297)

Fixes [DHIS2-6751]

Set the following Material-ui modal properties:

* disableAutoFocus: maintain focus in filter text field when item select Popover opens
* disableRestoreFocus: remove focus from filter text field when Popover closes (to match pre-existing behaviour)
  • Loading branch information
jenniferarnesen authored Apr 29, 2019
1 parent aae3a37 commit 771854e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/ItemSelect/ItemSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class ItemSelect extends React.Component {
transformOrigin={{ horizontal: 'left', vertical: 'top' }}
style={{ height: '70vh' }}
PaperProps={{ style: { width: '700px' } }}
disableAutoFocus={true}
disableRestoreFocus={true}
>
{this.popoverChildren(this.state.items)}
</Popover>
Expand Down

0 comments on commit 771854e

Please sign in to comment.