Skip to content

Commit

Permalink
fix(primeng/p-chips): docs and type of property separator (#12651)
Browse files Browse the repository at this point in the history
Fixes #12640.
  • Loading branch information
volvachev authored Aug 21, 2023
1 parent d0edf7e commit 3ae5bbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/components/chips/chips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
* Separator char to add an item when pressed in addition to the enter key.
* @group Props
*/
@Input() separator: string | undefined;
@Input() separator: string | RegExp | undefined;
/**
* When enabled, a clear icon is displayed to clear the value.
* @group Props
Expand Down Expand Up @@ -246,7 +246,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
onPaste(event: any) {
if (!this.disabled) {
if (this.separator) {
let pastedData = (event.clipboardData || (this.document.defaultView as any)['clipboardData']).getData('Text');
const pastedData: string = (event.clipboardData || (this.document.defaultView as any)['clipboardData']).getData('Text');
pastedData.split(this.separator).forEach((val: any) => {
this.addItem(event, val, true);
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -6526,7 +6526,7 @@
"name": "separator",
"optional": false,
"readonly": false,
"type": "string",
"type": "string | RegExp",
"description": "Separator char to add an item when pressed in addition to the enter key."
},
{
Expand Down

1 comment on commit 3ae5bbe

@vercel
Copy link

@vercel vercel bot commented on 3ae5bbe Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.