Skip to content

Commit b557ca9

Browse files
authored
Fix ActionBar and TableView editing (#9353)
1 parent bd84160 commit b557ca9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/@react-spectrum/s2/src/ActionBar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const ActionBar = forwardRef(function ActionBar(props: ActionBarProps, re
108108

109109
const ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps & {isExiting: boolean}, ref: ForwardedRef<HTMLDivElement | null>) {
110110
// eslint-disable-next-line @typescript-eslint/no-unused-vars
111-
let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting, slot, ...otherProps} = props;
111+
let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting, slot, scrollRef, ...otherProps} = props;
112112
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
113113

114114
// Store the last count greater than zero so that we can retain it while rendering the fade-out animation.
@@ -118,7 +118,6 @@ const ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps
118118
}
119119

120120
// Measure the width of the collection's scrollbar and offset the action bar by that amount.
121-
let scrollRef = props.scrollRef;
122121
let [scrollbarWidth, setScrollbarWidth] = useState(0);
123122
let updateScrollbarWidth = useCallback(() => {
124123
let el = scrollRef?.current;

packages/dev/s2-docs/pages/s2/TableView.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,9 @@ export default function EditableTable(props) {
481481
name={column.id! as string} />
482482
)}>
483483
<div className={style({display: 'flex', alignItems: 'center', gap: 8, justifyContent: 'space-between'})}>
484-
{item[column.id]}
484+
<span className={style({minWidth: 0, truncate: true})}>
485+
{item[column.id]}
486+
</span>
485487
<ActionButton slot="edit" aria-label="Edit fruit">
486488
<Edit />
487489
</ActionButton>

0 commit comments

Comments
 (0)