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

Can't change years and months in IE #95 #110

Merged
merged 2 commits into from
Mar 15, 2019
Merged
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
13 changes: 13 additions & 0 deletions src/lib/checkIE.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** Return true if run on Internet Explorer. */
const checkIE = () => {
if (navigator.appName === 'Microsoft Internet Explorer'
|| !!(navigator.userAgent.match(/Trident/)
|| navigator.userAgent.match(/rv:11/))
) {
return true;
}

return false;
};

export default checkIE;
5 changes: 3 additions & 2 deletions src/views/InputView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
SemanticTRANSITIONS,
Transition,
} from 'semantic-ui-react';
import checkIE from '../lib/checkIE';

const popupStyle = {
padding: '0',
Expand Down Expand Up @@ -162,7 +163,7 @@ class InputView extends React.Component<InputViewProps, any> {
} = this.props;

const onBlur = (e) => {
if (e.relatedTarget !== this.popupNode && e.relatedTarget !== this.inputNode) {
if (e.relatedTarget !== this.popupNode && e.relatedTarget !== this.inputNode && !checkIE()) {
closePopup();
}
};
Expand Down Expand Up @@ -192,7 +193,7 @@ class InputView extends React.Component<InputViewProps, any> {
<FormInputWithRef
{...rest}
icon={icon}
iconPosition={icon && iconPosition !== 'right' ? iconPosition : undefined }
iconPosition={icon && iconPosition !== 'right' ? iconPosition : undefined}
innerRef={(e) => { this.inputNode = e; onMount(e); }}
value={value}
tabIndex={tabIndex}
Expand Down
Loading