]> cat aescling's git repositories - mastodon.git/commitdiff
Minor improvements to poll composing UI (#12319)
authorThibG <thib@sitedethib.com>
Thu, 7 Nov 2019 07:06:06 +0000 (08:06 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 7 Nov 2019 07:06:06 +0000 (09:06 +0200)
- Disable the “add option” button instead of hiding it
- Allow poll option inputs to scale to full width

app/javascript/mastodon/features/compose/components/poll_form.js
app/javascript/styles/mastodon/components.scss

index 211601d520602fb02a6d1c357138120ed991167e..898f956b0c0f79eb3e7ce9d98ec70b86ca4309dc 100644 (file)
@@ -142,9 +142,7 @@ class PollForm extends ImmutablePureComponent {
         </ul>
 
         <div className='poll__footer'>
-          {options.size < 4 && (
-            <button className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
-          )}
+          <button disabled={options.size >= 4} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
 
           <select value={expiresIn} onChange={this.handleSelectDuration}>
             <option value={300}>{intl.formatMessage(messages.minutes, { number: 5 })}</option>
index 417e8c899028f2499578cc17bfccb2c5f27d061c..ded668aea506bfeea39b45bfad70043177f401c9 100644 (file)
   .autosuggest-input,
   .spoiler-input {
     position: relative;
+    width: 100%;
   }
 
   .spoiler-input {