Skip to content

Commit 3f24700

Browse files
committed
Do not close popover after publish date is changed
1 parent af33e68 commit 3f24700

File tree

1 file changed

+2
-10
lines changed
  • packages/editor/src/components/post-schedule

1 file changed

+2
-10
lines changed

packages/editor/src/components/post-schedule/index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { __experimentalGetSettings } from '@wordpress/date';
55
import { useDispatch, useSelect } from '@wordpress/data';
66
import { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';
7-
import { useRef, useState, useMemo } from '@wordpress/element';
7+
import { useState, useMemo } from '@wordpress/element';
88
import { store as coreStore } from '@wordpress/core-data';
99

1010
/**
@@ -61,7 +61,6 @@ export default function PostSchedule( { onClose } ) {
6161
[ eventsByPostType ]
6262
);
6363

64-
const ref = useRef();
6564
const settings = __experimentalGetSettings();
6665

6766
// To know if the current timezone is a 12 hour time with look for "a" in the time format
@@ -75,17 +74,10 @@ export default function PostSchedule( { onClose } ) {
7574
.join( '' ) // Reverse the string and test for "a" not followed by a slash.
7675
);
7776

78-
function onChange( newDate ) {
79-
onUpdateDate( newDate );
80-
const { ownerDocument } = ref.current;
81-
ownerDocument.activeElement.blur();
82-
}
83-
8477
return (
8578
<PublishDateTimePicker
86-
ref={ ref }
8779
currentDate={ postDate }
88-
onChange={ onChange }
80+
onChange={ onUpdateDate }
8981
is12Hour={ is12HourTime }
9082
events={ events }
9183
onMonthPreviewed={ setPreviewedMonth }

0 commit comments

Comments
 (0)