Skip to content

Commit

Permalink
Fix #3238: Remove IE Support (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 24, 2023
1 parent 8070ccf commit f102445
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
10 changes: 0 additions & 10 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const Calendar = React.memo(
const inputRef = React.useRef(props.inputRef);
const navigation = React.useRef(null);
const ignoreFocusFunctionality = React.useRef(false);
const isKeydown = React.useRef(false);
const timePickerTimer = React.useRef(null);
const viewStateChanged = React.useRef(false);
const touchUIMask = React.useRef(null);
Expand Down Expand Up @@ -97,8 +96,6 @@ export const Calendar = React.memo(
};

const onInputKeyDown = (event) => {
isKeydown.current = true;

switch (event.which) {
//escape
case 27: {
Expand All @@ -120,13 +117,6 @@ export const Calendar = React.memo(
};

const onUserInput = (event) => {
// IE 11 Workaround for input placeholder
if (!isKeydown.current) {
return;
}

isKeydown.current = false;

updateValueOnInput(event, event.target.value);
props.onInput && props.onInput(event);
};
Expand Down
24 changes: 1 addition & 23 deletions components/lib/fileupload/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const FileUpload = React.memo(
const fileInputRef = React.useRef(null);
const messagesRef = React.useRef(null);
const contentRef = React.useRef(null);
const duplicateIEEvent = React.useRef(false);
const uploadedFileCount = React.useRef(0);
const hasFiles = ObjectUtils.isNotEmpty(filesState);
const hasUploadedFiles = ObjectUtils.isNotEmpty(uploadedFilesState);
Expand Down Expand Up @@ -93,13 +92,6 @@ export const FileUpload = React.memo(
}
};

const clearIEInput = () => {
if (fileInputRef.current) {
duplicateIEEvent.current = true; //IE11 fix to prevent onFileChange trigger again
fileInputRef.current.value = '';
}
};

const formatSize = (bytes) => {
const k = 1024;
const dm = 3;
Expand All @@ -121,12 +113,6 @@ export const FileUpload = React.memo(
return;
}

if (event.type !== 'drop' && isIE11() && duplicateIEEvent.current) {
duplicateIEEvent.current = false;

return;
}

let currentFiles = [];

if (props.multiple) {
Expand Down Expand Up @@ -157,11 +143,7 @@ export const FileUpload = React.memo(
props.onSelect({ originalEvent: event, files: currentFiles });
}

if (event.type !== 'drop' && isIE11()) {
clearIEInput();
} else {
clearInput();
}
clearInput();

if (props.mode === 'basic' && currentFiles.length > 0) {
fileInputRef.current.style.display = 'none';
Expand All @@ -172,10 +154,6 @@ export const FileUpload = React.memo(
return filesState.some((f) => f.name + f.type + f.size === file.name + file.type + file.size);
};

const isIE11 = () => {
return !!window['MSInputMethodContext'] && !!document['documentMode'];
};

const validate = (file) => {
if (props.maxFileSize && file.size > props.maxFileSize) {
const message = {
Expand Down

0 comments on commit f102445

Please sign in to comment.