Skip to content

fix safari download dropdown not getting closed #2600

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

Closed
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions client/modules/IDE/components/SketchList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import OutsideClickHandler from 'react-outside-click-handler';
import { Helmet } from 'react-helmet';
import { withTranslation } from 'react-i18next';
import { connect } from 'react-redux';
Expand Down Expand Up @@ -27,6 +28,8 @@ import MoreIconSvg from '../../../images/more.svg';

const ROOT_URL = getConfig('API_URL');

const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);

const formatDateCell = (date, mobile = false) =>
dates.format(date, { showTime: !mobile });

Expand Down Expand Up @@ -227,6 +230,15 @@ class SketchListRowBase extends React.Component {
onFocus={this.onFocusComponent}
>
{this.props.t('SketchList.DropdownDownload')}
{isSafari && (
<OutsideClickHandler
onOutsideClick={() => {
this.setState({
optionsOpen: false
});
}}
/>
)}
</button>
</li>
{this.props.user.authenticated && (
Expand Down
Loading