mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: action button transparency causing setting display issue on hover (#6529)
* fix: button transparency causing setting display issue on hover * fix: button transparency causing setting display issue on hover
This commit is contained in:
parent
85e3019e44
commit
437e9dba52
@ -582,6 +582,7 @@ const RenderButtonInner = observer(
|
||||
}
|
||||
|
||||
const actionTitle = title || field?.title;
|
||||
const { opacity, ...restButtonStyle } = buttonStyle;
|
||||
|
||||
return (
|
||||
<SortableItem
|
||||
@ -591,15 +592,19 @@ const RenderButtonInner = observer(
|
||||
onMouseEnter={handleMouseEnter}
|
||||
// @ts-ignore
|
||||
loading={field?.data?.loading || loading}
|
||||
icon={typeof icon === 'string' ? <Icon type={icon} /> : icon}
|
||||
icon={typeof icon === 'string' ? <Icon style={{ opacity }} type={icon} /> : icon}
|
||||
disabled={disabled}
|
||||
style={buttonStyle}
|
||||
style={restButtonStyle}
|
||||
onClick={process.env.__E2E__ ? handleButtonClick : debouncedClick} // E2E 中的点击操作都是很快的,如果加上 debounce 会导致 E2E 测试失败
|
||||
component={tarComponent || Button}
|
||||
className={classnames(componentCls, hashId, className, 'nb-action')}
|
||||
type={type === 'danger' ? undefined : type}
|
||||
>
|
||||
{actionTitle && <span className={icon ? 'nb-action-title' : null}>{actionTitle}</span>}
|
||||
{actionTitle && (
|
||||
<span className={icon ? 'nb-action-title' : null} style={{ opacity }}>
|
||||
{actionTitle}
|
||||
</span>
|
||||
)}
|
||||
<Designer {...designerProps} />
|
||||
</SortableItem>
|
||||
);
|
||||
|
@ -267,11 +267,6 @@ function FinallyButton({
|
||||
}) {
|
||||
const { getCollection } = useCollectionManager_deprecated();
|
||||
const aclCtx = useACLActionParamsContext();
|
||||
const buttonStyle = useMemo(() => {
|
||||
return {
|
||||
opacity: designable && (field?.data?.hidden || !aclCtx) && 0.1,
|
||||
};
|
||||
}, [designable, field?.data?.hidden]);
|
||||
|
||||
if (inheritsCollections?.length > 0) {
|
||||
if (!linkageFromForm) {
|
||||
@ -281,7 +276,6 @@ function FinallyButton({
|
||||
danger={props.danger}
|
||||
type={componentType}
|
||||
icon={<DownOutlined />}
|
||||
style={{ ...props?.style, ...buttonStyle }}
|
||||
buttonsRender={([leftButton, rightButton]) => [
|
||||
React.cloneElement(leftButton as React.ReactElement<any, string>, {
|
||||
style: props?.style,
|
||||
@ -302,13 +296,7 @@ function FinallyButton({
|
||||
) : (
|
||||
<Dropdown menu={menu}>
|
||||
{
|
||||
<Button
|
||||
aria-label={props['aria-label']}
|
||||
icon={icon}
|
||||
type={componentType}
|
||||
danger={props.danger}
|
||||
style={{ ...props?.style, ...buttonStyle }}
|
||||
>
|
||||
<Button aria-label={props['aria-label']} icon={icon} type={componentType} danger={props.danger}>
|
||||
{props.children} <DownOutlined />
|
||||
</Button>
|
||||
}
|
||||
@ -333,7 +321,6 @@ function FinallyButton({
|
||||
style={{
|
||||
display: !designable && field?.data?.hidden && 'none',
|
||||
opacity: designable && field?.data?.hidden && 0.1,
|
||||
...buttonStyle,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
@ -355,7 +342,7 @@ function FinallyButton({
|
||||
...props?.style,
|
||||
display: !designable && field?.data?.hidden && 'none',
|
||||
opacity: designable && field?.data?.hidden && 0.1,
|
||||
...buttonStyle,
|
||||
height: '100%',
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
|
@ -112,11 +112,7 @@ export const DuplicateAction = observer(
|
||||
}),
|
||||
)
|
||||
: record[collection.filterTargetKey] || id;
|
||||
const buttonStyle = useMemo(() => {
|
||||
return {
|
||||
opacity: designable && (field?.data?.hidden || !aclCtx) && 0.1,
|
||||
};
|
||||
}, [designable, field?.data?.hidden]);
|
||||
|
||||
const template = {
|
||||
key: 'duplicate',
|
||||
dataId,
|
||||
@ -198,7 +194,6 @@ export const DuplicateAction = observer(
|
||||
opacity: designable && field?.data?.hidden && 0.1,
|
||||
cursor: loading ? 'not-allowed' : 'pointer',
|
||||
position: 'relative',
|
||||
...buttonStyle,
|
||||
}}
|
||||
onClick={handelDuplicate}
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user