]> cat aescling's git repositories - mastodon.git/commitdiff
Fix privacy dropdown active state when dropdown is placed on top of it (#11495)
authorThibG <thib@sitedethib.com>
Tue, 6 Aug 2019 09:59:14 +0000 (11:59 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 6 Aug 2019 09:59:14 +0000 (11:59 +0200)
app/javascript/mastodon/features/compose/components/privacy_dropdown.js

index d02a55be00e4cd80de028b249fc86fd3a4920acb..9db098544afad714d4760c85be21d7386184b807 100644 (file)
@@ -229,7 +229,7 @@ class PrivacyDropdown extends React.PureComponent {
 
     return (
       <div className={classNames('privacy-dropdown', placement, { active: open })} onKeyDown={this.handleKeyDown}>
-        <div className={classNames('privacy-dropdown__value', { active: this.options.indexOf(valueOption) === 0 })}>
+        <div className={classNames('privacy-dropdown__value', { active: this.options.indexOf(valueOption) === (placement === 'bottom' ? 0 : (this.options.length - 1)) })}>
           <IconButton
             className='privacy-dropdown__value-icon'
             icon={valueOption.icon}