Skip to content

Commit fe389bc

Browse files
authored
fix(VariantManagement): fix dirty-state and readOnly behavior (#6628)
Fixes #6622 Fixes #6617 **Thank you for your contribution!** 👏 To get it merged faster, kindly review the checklist below: ## Pull Request Checklist - [x] Reviewed the [Contributing Guidelines](https://github.com/SAP/ui5-webcomponents-react/blob/main/CONTRIBUTING.md) + Especially the [How to Contribute](https://github.com/SAP/ui5-webcomponents-react/blob/main/CONTRIBUTING.md#contribute-code) section - [x] [Correct commit message style](https://github.com/SAP/ui5-webcomponents-react/blob/main/docs/Guidelines.md#commit-message-style)
1 parent b5859ed commit fe389bc

File tree

1 file changed

+1
-2
lines changed
  • packages/main/src/components/VariantManagement

1 file changed

+1
-2
lines changed

packages/main/src/components/VariantManagement/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,7 @@ const VariantManagement = forwardRef<HTMLDivElement, VariantManagementPropTypes>
317317
}
318318
}, [safeChildrenWithFavorites]);
319319

320-
// todo: this applies if `readOnly` is set to `false` as well since the value is read via data-attribute and is therefore a string not a boolean
321-
const showSaveBtn = dirtyState && !Object.prototype.hasOwnProperty.call(selectedVariant, 'readOnly');
320+
const showSaveBtn = dirtyState && selectedVariant && !selectedVariant.readOnly;
322321

323322
return (
324323
<div className={variantManagementClasses} style={style} {...rest} ref={ref}>

0 commit comments

Comments
 (0)