Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/scratch-gui/src/containers/costume-tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ class CostumeTab extends React.Component {
}
componentDidMount () {
this.handleDocumentClick = () => {
if (document.activeElement !== document.body) {
// If the costume tab is focused and the user clicks outside of it, unfocus the costume tab.
// This is to prevent keypresses from affecting the tabs when users try to interact with the paint editor
if (document.activeElement instanceof HTMLLIElement && document.activeElement.role === 'tab') {
document.activeElement.blur();
}
};
Expand Down
Loading