Skip to content

Commit

Permalink
Fix: Default attribute on audio preload (#21735)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Apr 21, 2020
1 parent e19b804 commit e3e6b2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/block-library/src/audio/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ class AudioEdit extends Component {
/>
<SelectControl
label={ __( 'Preload' ) }
value={ undefined !== preload ? preload : 'none' }
value={ preload || '' }
// `undefined` is required for the preload attribute to be unset.
onChange={ ( value ) =>
setAttributes( {
preload:
'none' !== value ? value : undefined,
preload: value || undefined,
} )
}
options={ [
{ value: '', label: __( 'Browser default' ) },
{ value: 'auto', label: __( 'Auto' ) },
{ value: 'metadata', label: __( 'Metadata' ) },
{ value: 'none', label: __( 'None' ) },
Expand Down

0 comments on commit e3e6b2d

Please sign in to comment.