-
-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Description
Describe the bug
When a cell contains the pipe character | it disapear in the copied value when value is copied through right click context menu + Copy
I fixed it locally by removing unnecessary pipes in the regex in the function copyCellToClipboard of formatterUtilities extension. Pipes are not recognized as OR operator inside squared brackets, but as actual pipe character.
diff --git a/node_modules/@slickgrid-universal/common/dist/formatters/formatterUtilities.js b/node_modules/@slickgrid-universal/common/dist/formatters/formatterUtilities.js
index c50f5a0..f60c0d9 100644
--- a/node_modules/@slickgrid-universal/common/dist/formatters/formatterUtilities.js
+++ b/node_modules/@slickgrid-universal/common/dist/formatters/formatterUtilities.js
@@ -57,9 +57,9 @@ export async function copyCellToClipboard(args) {
finalTextToCopy = textToCopy;
if (typeof textToCopy === 'string') {
finalTextToCopy = textToCopy
- .replace(/^([·|⮞|⮟]\s*)|([·|⮞|⮟])\s*/gi, '')
+ .replace(/^([·⮞⮟]\s*)|([·⮞⮟])\s*/gi, '')
// eslint-disable-next-line
- .replace(/[\u00b7|\u034f]/gi, '')
+ .replace(/[·◌͏]/gi, '')
.trim();
}Reproduction
Go to this demo :
https://ghiscoding.github.io/angular-slickgrid-demos/#/example35
Change a value to something that contains a pipe |
Then, when editor is hidden, right click on the cell and click on "Copy" button of the context menu :
Then, test pasting anywhere else, the pipe has disapeared
Which Framework are you using?
Angular
Environment Info
| Executable | Version |
| ------------------- | ------- |
| (framework used) | Angular |
| Slickgrid-Universal | 9.10.0 |
| TypeScript | 5.5.4 |
| Browser(s) | Chrome 145 |
| System OS | Windows 11 |Validations
- Follow our Code of Conduct
- Read the Wikis.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels