Skip to content

Commit

Permalink
Update ContextMenu.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gnbm committed Aug 21, 2024
1 parent bc0fe85 commit 1156f28
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Providers/DataGrid/Wijmo/Features/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,12 @@ namespace Providers.DataGrid.Wijmo.Feature {
const menuItem = this._menuItems.get(menuItemId);
if (menuItem) {
if (menuItem.hasOwnProperty(propertyName)) {
menuItem[propertyName] = propertyValue;
if (propertyName === 'label' && this.grid.config.sanitizeInputValues) {
// Sanitize the label if the configuration is set to do so
menuItem.label = OSFramework.DataGrid.Helper.Sanitize(propertyValue as string);
} else {
menuItem[propertyName] = propertyValue;
}
} else {
console.error(`MenuItem "${menuItem.label}" has no property "${propertyName}" defined.`);
}
Expand Down

0 comments on commit 1156f28

Please sign in to comment.