title: Select: Limit number of selected options
body: <p>I'm using <a href="https://ant.design/components/select/" rel="nofollow noreferrer">ANT Design's Select component</a> in multiple select mode. After two options are selected (see screenshot) I'd like to prevent any more from being selected. The field should not be disabled, so that you can deselect an option and select another.</p>
  
  <p>I've tried the <code>onFocus</code> event, but it doesn't provide an event that I could use to <code>preventDefault</code> or otherwise keep from opening the dropdown. I've also tried adding a ref and calling <code>blur()</code> whenever the <code>onFocus</code> event is called. This closes the dropdown, but it's still visible for a second.</p>
  
  <p>Does anyone know of a way to accomplish this? </p>
  
  <p><a href="https://i.stack.imgur.com/jhAju.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jhAju.png" alt="enter image description here"></a></p>