-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Table): added ActionsColumn prop to control close on click #10179
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Unchanged files with check annotations Beta
const [scrollElement, setScrollElement] = React.useState(null); | ||
const toggleVisible = () => { | ||
Check warning on line 36 in packages/react-core/src/components/BackToTop/BackToTop.tsx
|
||
if (scrollElement) { | ||
const scrolled = scrollElement.scrollY ? scrollElement.scrollY : scrollElement.scrollTop; | ||
if (!isAlwaysVisible) { |
} else if (!dateProp) { | ||
setFocusedDate(today); | ||
} | ||
}, [dateProp]); | ||
useEffect(() => { | ||
// Calendar month should not be focused on page load | ||
if ((shouldFocus || isDateFocused) && focusedDateValidated && focusRef.current) { | ||
focusRef.current.focus(); | ||
} | ||
}, [focusedDate, isDateFocused, focusedDateValidated, focusRef]); | ||
const onMonthClick = (ev: React.MouseEvent, newDate: Date) => { | ||
setFocusedDate(newDate); |
test('Renders label before checkbox input if isLabelBeforeButton is provided', () => { | ||
render(<Checkbox id="test-id" isLabelBeforeButton label={'test checkbox label'} />); | ||
const wrapper = screen.getByRole('checkbox').parentElement!; | ||
expect(wrapper.children[0].tagName).toBe('LABEL'); | ||
expect(wrapper.children[1].tagName).toBe('INPUT'); |
const [selectOpen, setSelectOpen] = React.useState(false); | ||
const [pristine, setPristine] = React.useState(true); | ||
const [textInputFocused, setTextInputFocused] = React.useState(false); | ||
const widthChars = React.useMemo(() => Math.max(dateFormat(new Date()).length, placeholder.length), [dateFormat]); | ||
const style = { [cssFormControlWidthChars.name]: widthChars, ...styleProps }; | ||
const buttonRef = React.useRef<HTMLButtonElement>(); | ||
const datePickerWrapperRef = React.useRef<HTMLDivElement>(); | ||
React.useEffect(() => { | ||
setValue(valueProp); | ||
setValueDate(dateParse(valueProp)); | ||
}, [valueProp]); | ||
Check warning on line 145 in packages/react-core/src/components/DatePicker/DatePicker.tsx
|
||
React.useEffect(() => { | ||
setPristine(!value); | ||
if (value === '' && !pristine && !textInputFocused) { | ||
dateIsRequired ? setErrorText(emptyDateText) : setErrorText(''); | ||
} | ||
}, [value]); | ||
Check warning on line 156 in packages/react-core/src/components/DatePicker/DatePicker.tsx
|
||
const setError = (date: Date) => { | ||
setErrorText(validators.map((validator) => validator(date)).join('\n') || ''); | ||
}, | ||
isCalendarOpen: popoverOpen | ||
}), | ||
[setPopoverOpen, popoverOpen, selectOpen] | ||
); | ||
const createFocusSelectorString = (modifierClass: string) => |
drawerRef.current.classList.remove(css(styles.modifiers.resizing)); | ||
isResizing = false; | ||
onResize && onResize(e, currWidth, id); | ||
setInitialVals = true; | ||
Check warning on line 245 in packages/react-core/src/components/Drawer/DrawerPanelContent.tsx
|
||
document.removeEventListener('mousemove', callbackMouseMove); | ||
document.removeEventListener('mouseup', callbackMouseUp); | ||
}; | ||
document.removeEventListener('touchend', callbackTouchEnd); | ||
}; | ||
const callbackMouseMove = React.useCallback(handleMouseMove, []); | ||
const callbackTouchEnd = React.useCallback(handleTouchEnd, []); | ||
const callbackTouchMove = React.useCallback(handleTouchMove, []); | ||
const callbackMouseUp = React.useCallback(handleMouseup, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per above I've added this prop. From what I can tell since ActionsColumn has its own isOpen state, being able to pass a custom onOpenChange callback wouldn't be as easy without introducing other props to customize things, and at that point I'd wonder if it wouldjust make more sense to allow passing a custom Dropdown itself (rather than right now we only really allow a custom
actionsToggle
)