Skip to content

Commit

Permalink
Fix primefaces#3238: Remove IE Support
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 3, 2022
1 parent b33ea5e commit a631fa9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
9 changes: 0 additions & 9 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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 @@ -74,8 +73,6 @@ export const Calendar = React.memo(
};

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

switch (event.which) {
//escape
case 27: {
Expand All @@ -97,12 +94,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
23 changes: 1 addition & 22 deletions components/lib/fileupload/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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 disabled = props.disabled || uploadingState;
Expand Down Expand Up @@ -52,13 +51,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) => {
if (bytes === 0) {
return '0 B';
Expand All @@ -77,11 +69,6 @@ export const FileUpload = React.memo(
return;
}

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

let currentFiles = [];
if (props.multiple) {
currentFiles = filesState ? [...filesState] : [];
Expand Down Expand Up @@ -109,11 +96,7 @@ export const FileUpload = React.memo(
props.onSelect({ originalEvent: event, files: selectedFiles });
}

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

if (props.mode === 'basic' && currentFiles.length > 0) {
fileInputRef.current.style.display = 'none';
Expand All @@ -124,10 +107,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 a631fa9

Please sign in to comment.