@salutejs/plasma-new-hope 0.141.0-canary.1422.10737462879.0 → 0.141.0-canary.1422.10774325656.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -296,10 +296,12 @@ type Items = Array<{
296
296
  Свойство alwaysOpened позволяет отображать Combobox всегда открытым. При этом closeAfterSelect игнорируется.
297
297
 
298
298
  ```tsx live
299
- import React from 'react';
300
- import { Combobox } from '@salutejs/{{ package }}';
299
+ import React, { useState } from 'react';
300
+ import { Combobox, Button } from '@salutejs/{{ package }}';
301
301
 
302
302
  export function App() {
303
+ const [alwaysOpened, setAlwaysOpened] = useState(false);
304
+
303
305
  const items = [
304
306
  {
305
307
  value: 'north_america',
@@ -324,12 +326,13 @@ type Items = Array<{
324
326
  return (
325
327
  <div style=\{{ height: '300px' }}>
326
328
  <div style=\{{width: '300px'}}>
329
+ <Button text={ alwaysOpened ? 'По умолчанию' : 'Всегда открыт' } onClick={() => setAlwaysOpened(!alwaysOpened)} style={{ marginBottom: '1rem' }} />
327
330
  <Combobox
328
331
  items={items}
329
332
  placeholder="Placeholder"
330
333
  label="Label"
331
334
  helperText="Helper text"
332
- alwaysOpened
335
+ alwaysOpened={alwaysOpened}
333
336
  />
334
337
  </div>
335
338
  </div>