Skip to content

Commit

Permalink
Fix the selected item on select boxes in the calendar, #1508
Browse files Browse the repository at this point in the history
  • Loading branch information
andergmartins committed Dec 15, 2023
1 parent c858139 commit 00c5e5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/calendar/lib/async-calendar/js/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function Select(props) {

if (props.options) {
options = props.options.map(option => {
return <option key={`select-option-${option.value}`} value={option.value} selected={option.value === props.value}>{option.text}</option>
return <option key={`select-option-${option.value}`} value={option.value}>{option.text}</option>
});
}

Expand All @@ -98,6 +98,7 @@ export default function Select(props) {
className += props.metadata ? 'pp-calendar-form-metafied ' + props.post_types : '';
return (
<select className={className}
defaultValue={props.value}
type="select"
name={props.name}
id={props.id}
Expand Down
2 changes: 1 addition & 1 deletion modules/calendar/lib/async-calendar/js/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00c5e5d

Please sign in to comment.