From ab7d2962caea4402d724c694310dcde7113c57ab Mon Sep 17 00:00:00 2001 From: llj Date: Tue, 30 May 2023 20:41:47 +0800 Subject: [PATCH] [share dialog] share/upload link: modified 'expiration time' setting('date time picker') (#5490) --- .../src/components/date-and-time-picker.js | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/frontend/src/components/date-and-time-picker.js b/frontend/src/components/date-and-time-picker.js index bf0ec833ac..f2b2b8150a 100644 --- a/frontend/src/components/date-and-time-picker.js +++ b/frontend/src/components/date-and-time-picker.js @@ -21,39 +21,12 @@ class Picker extends React.Component { this.defaultCalendarValue = null; this.calendarContainerRef = React.createRef(); this.inputRef = React.createRef(); - this.state = { - isOpen: false - }; - } - - closeDialog = () => { - this.setState({ - isOpen: false - }); - } - - openDialog = () => { - this.setState({ - isOpen: true - }); - } - - clickOutsideToClose = (e) => { - if (!this.inputRef.current.contains(e.target) && - !this.calendarContainerRef.current.contains(e.target)) { - this.closeDialog(); - } } componentDidMount() { let lang = window.app.config.lang; this.defaultCalendarValue = moment().locale(lang).clone(); - document.addEventListener('click', this.clickOutsideToClose); - } - - componentWillUnmount() { - document.removeEventListener('click', this.clickOutsideToClose); } getCalendarContainer = () => { @@ -83,7 +56,6 @@ class Picker extends React.Component { getCalendarContainer={this.getCalendarContainer} calendar={calendar} value={props.value} - open={this.state.isOpen} onChange={props.onChange} > { @@ -98,7 +70,6 @@ class Picker extends React.Component { readOnly={true} value={value && value.format(FORMAT) || ''} className="form-control" - onClick={this.openDialog} ref={this.inputRef} />