Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: margaretkennedy <[email protected]>
  • Loading branch information
dgodinez-dh and margaretkennedy authored Jan 10, 2025
1 parent 614f5be commit b59f939
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions plugins/ui/docs/components/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ my_open_action_example = open_action_example()

## Selection

Menu supports multiple selection modes. By default, selection is disabled, however this can be changed using the `selection_mode` prop. Use `default_selected_keys` to provide a default set of selected items (uncontrolled) or `selected_keys` to set the selected items (controlled). The values of the selected keys must match the key props of the items.
Menu supports multiple selection modes. By default, selection is disabled. However, this can be changed using the `selection_mode` prop. Use `default_selected_keys` to provide a default set of selected items (uncontrolled) or `selected_keys` to set the selected items (controlled). The values of the selected keys must match the key props of the items.

```python
from deephaven import ui
Expand Down Expand Up @@ -177,17 +177,17 @@ def sections_example():
my_sections_example = sections_example()
```

## Unavailable Items
## Unavailable items

`contextual_help_trigger` disables a menu item's action and replaces it with a popover with information on why the item is unavailable and may link users to more information elsewhere.

The `contextual_help_trigger` accepts exactly two children: the `item` which triggers opening of the `dialog` and the Dialog itself. The trigger must be the first child passed into the `contextual_help_trigger` and should be an `item`. Similar to `contextual_help`, the layout of the `dialog` is very deliberate. See [`contextual_help`](./contextual_help.md) for further explanation.

Setting the `is_unavailable` prop on the `contextual_help_trigger` makes the menu item unavailable and enables the `dialog` with contextual help, allowing for programmatic control.

Note that the `menu's` `on_action` and `on_change` callbacks will not fire for items made unavailable by a `contextual_help_trigger`.
Note that the `menu`s `on_action` and `on_change` callbacks will not fire for items made unavailable by a `contextual_help_trigger`.

The example below illustrates how one would setup a `menu` to use `contextual_help_trigger`.
The example below illustrates how one would set up a `menu` to use `contextual_help_trigger`.

```python
from deephaven import ui
Expand Down
8 changes: 4 additions & 4 deletions plugins/ui/docs/components/menu_trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The `menu_trigger` accepts exactly two children: the element which triggers the

## Events

`menu_trigger` accepts an `on_open_change` handler which is triggered whenever the `menu` is opened or closed.
`menu_trigger` accepts an `on_open_change` handler, which is triggered whenever the `menu` is opened or closed.

```python
from deephaven import ui
Expand Down Expand Up @@ -54,9 +54,9 @@ my_open_change_example = open_change_example()

## Long press

By default, a menu_trigger's menu is opened by pressing the trigger element or activating it via the Space or Enter keys. However, there may be cases in which your trigger element should perform a separate default action on press such as selection, and should only display the menu when long pressed. This behavior can be changed by providing `longPress` to the `trigger` prop. With this prop, the menu will only be opened upon pressing and holding the trigger element or by using the Option (Alt on Windows) + Down Arrow/Up Arrow keys while focusing the trigger element.
By default, a `menu_trigger`'s menu is opened by pressing the trigger element or activating it via the Space or Enter keys. However, there may be cases where your trigger element should perform a separate default action on press, such as selection, and should only display the menu when long-pressed. This behavior can be changed by providing `longPress` to the `trigger` prop. With this prop, the menu will only be opened upon pressing and holding the trigger element or by using the Option (Alt on Windows) + Down Arrow/Up Arrow keys while focusing the trigger element.

The example below illustrates how one would setup a `menu_trigger` to have long press behavior.
The example below illustrates how one would set up a `menu_trigger` to have long press behavior.

```python
from deephaven import ui
Expand All @@ -77,7 +77,7 @@ my_long_press_example = ui.menu_trigger(

### Align and direction

The `align` prop aligns the `menu` relative to the `trigger` and the direction prop controls the `direction` the `menu` will render
The `align` prop aligns the `menu` relative to the `trigger` and the direction prop controls the `direction` the `menu` will render.

```python
from deephaven import ui
Expand Down

0 comments on commit b59f939

Please sign in to comment.