Skip to content

Commit

Permalink
fix: Tab Panels contents should take up the full height (#340)
Browse files Browse the repository at this point in the history
- Fixes #175
- Tested using the snippet from within the ticket, as well as some other
examples with tab_panels in vertical orientation
  • Loading branch information
mofojed authored Mar 5, 2024
1 parent e3af9f5 commit 6028195
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
8 changes: 0 additions & 8 deletions plugins/ui/src/deephaven/ui/components/spectrum/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ def icon_wrapper(*children, **props):
return spectrum_element("Icon", *children, **props)


def item(*children, **props):
"""
Python implementation for the Adobe React Spectrum Item component.
Used with Tabs: https://react-spectrum.adobe.com/react-spectrum/Tabs.html
"""
return spectrum_element("Item", *children, **props)


def illustrated_message(*children, **props):
"""
Python implementation for the Adobe React Spectrum IllustratedMessage component.
Expand Down
2 changes: 1 addition & 1 deletion plugins/ui/src/js/src/elements/SpectrumElementUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Switch,
Tabs,
TabList,
TabPanels,
Text,
ToggleButton,
View,
Expand All @@ -25,6 +24,7 @@ import {
Form,
RangeSlider,
Slider,
TabPanels,
TextField,
} from './spectrum';
import { ELEMENT_KEY, ElementNode, isElementNode } from './ElementUtils';
Expand Down
21 changes: 21 additions & 0 deletions plugins/ui/src/js/src/elements/spectrum/TabPanels.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import {
TabPanels as SpectrumTabPanels,
SpectrumTabPanelsProps,
} from '@adobe/react-spectrum';

function TabPanels(props: SpectrumTabPanelsProps<React.ReactNode>) {
const { UNSAFE_style: unsafeStyle, ...otherProps } = props;

return (
<SpectrumTabPanels
// eslint-disable-next-line react/jsx-props-no-spreading
{...otherProps}
UNSAFE_style={{ display: 'flex', ...unsafeStyle }}
/>
);
}

TabPanels.displayName = 'TabPanels';

export default TabPanels;
1 change: 1 addition & 0 deletions plugins/ui/src/js/src/elements/spectrum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export { default as Flex } from './Flex';
export { default as Form } from './Form';
export { default as RangeSlider } from './RangeSlider';
export { default as Slider } from './Slider';
export { default as TabPanels } from './TabPanels';
export { default as TextField } from './TextField';

0 comments on commit 6028195

Please sign in to comment.