Skip to content

Commit

Permalink
lib: append Datepicker to document.body
Browse files Browse the repository at this point in the history
In dialogs a datepicker can be cut off, so instead of appending it
to the parent (the dialog) append it to document.body.
  • Loading branch information
jelly committed Oct 19, 2022
1 parent e345a2f commit e4b396e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/lib/cockpit-components-shutdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ export class ShutdownModal extends React.Component {
onChange={(d, ds) => this.updateDate(d, ds)}
placeholder={timeformat.dateShortFormat()}
validators={[this.dateRangeValidator]}
value={this.state.date} />
value={this.state.date}
appendTo={() => document.body} />
<TimePicker time={this.state.time} is24Hour
className='shutdown-time-picker'
id="shutdown-time"
Expand Down
3 changes: 2 additions & 1 deletion pkg/lib/serverTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ function ChangeSystimeBody({ state, errors, change }) {
weekStart={timeformat.firstDayOfWeek()}
placeholder={timeformat.dateShortFormat()}
onChange={d => change("manual_date", d)}
value={manual_date} />
value={manual_date}
appendTo={() => document.body} />
</ValidatedInput>
<ValidatedInput errors={errors} error_key="manual_time">
<TimePicker id="systime-time-input"
Expand Down

0 comments on commit e4b396e

Please sign in to comment.