diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c78a93e2fc..71cdd65667f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## [16.7.2](https://github.com/primefaces/primeng/tree/16.7.2) (2023-11-08) + +[Full Changelog](https://github.com/primefaces/primeng/compare/16.7.1...16.7.2) + +**Fixed bugs:** +- Overlay: p-overlay div not removed from DOM on hiding panel [\#12948](https://github.com/primefaces/primeng/issues/12948) +- Table / EditableColumn: onEditComplete emitts old data value and not the new one as documented [\#13708](https://github.com/primefaces/primeng/issues/13708) +- FileUpload: Input Triggered on Any Mouse Click [\#13722](https://github.com/primefaces/primeng/issues/13722) +- Toast | Position Class is there twice when using Angular SSR and Client Hydration [\#13784](https://github.com/primefaces/primeng/issues/13784) +- Dialog: bad drag behavior when keepInViewport is false [\#13856](https://github.com/primefaces/primeng/issues/13856) +- p-image-preview-indicator rendered when preview is false [\#14002](https://github.com/primefaces/primeng/issues/14002) +- TriStateCheckboxComponent: inputId not working [\#13946](https://github.com/primefaces/primeng/issues/13946) +- splitButton: close dropdown when default button is clicked [\#13962](https://github.com/primefaces/primeng/issues/13962) +- SelectButton in v16.7.1 is only partially fixed [\#14048](https://github.com/primefaces/primeng/issues/14048) + +## [16.7.1](https://github.com/primefaces/primeng/tree/16.7.1) (2023-11-06) + +[Full Changelog](https://github.com/primefaces/primeng/compare/16.7.0...16.7.1) + +**Fixed bugs:** +- BIG ERROR with DropDown [\#13996](https://github.com/primefaces/primeng/issues/13996) +- Component: p-dropdwon onChange is called multiple times at init [\#14005](https://github.com/primefaces/primeng/issues/14005) +- Change of Dropdown selection throws error: Cannot read properties of undefined (reading 'length') primeng dropdown [\#14007](https://github.com/primefaces/primeng/issues/14007) +- Dropdown filtering issues with array of strings [\#14011](https://github.com/primefaces/primeng/issues/14011) +- The ngModel directive can't set an item of dropdown in version 16.7.0 [\#14023](https://github.com/primefaces/primeng/issues/14023) +- ListBox | onClick event does not emit [\#14036](https://github.com/primefaces/primeng/issues/14036) +- ListBox | OnChange doesn't emit [\#14033](https://github.com/primefaces/primeng/issues/14033) +- onClick event listbox error v16.7.0 [\#13998](https://github.com/primefaces/primeng/issues/13998) +- MultiSelect | Input section receives focus on filter click. [\#14035](https://github.com/primefaces/primeng/issues/14035) +- Multiselect set value error v16.7.0 [\#13999](https://github.com/primefaces/primeng/issues/13999) +- SelectButton broken in v16.7.0 [\#14021](https://github.com/primefaces/primeng/issues/14021) +- Global filter to search tree-table is not returning all the relevant results [\#14016](https://github.com/primefaces/primeng/issues/14016) + ## [16.7.0](https://github.com/primefaces/primeng/tree/16.7.0) (2023-11-01) [Full Changelog](https://github.com/primefaces/primeng/compare/16.6.0...16.7.0) @@ -50,7 +83,7 @@ ## [16.5.0](https://github.com/primefaces/primeng/tree/16.5.0) (2023-10-11) -[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.1...16.5.0) +[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.2...16.5.0) **Deprecated:** - SlideMenu: Deprecate from PrimeNG [\#13830](https://github.com/primefaces/primeng/issues/13830) @@ -78,6 +111,15 @@ - p-dialog: ExpressionChangedAfterItHasBeenCheckedError with attr.aria-labelledby [\#13636](https://github.com/primefaces/primeng/issues/13636) - Textarea: autoResize doesn't work when used inside a Dialog [\#9231](https://github.com/primefaces/primeng/issues/9231) +## [16.4.2](https://github.com/primefaces/primeng/tree/16.4.2) (2023-11-10) + +[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.1...16.4.2) + +**Fixed bugs:** + +- TreeTable | Global filter to search tree-table is not returning all the relevant results [\#14082](https://github.com/primefaces/primeng/issues/14082) +- Dropdown | FocusTrap doesn't allow user to tab on next element [\#14083](https://github.com/primefaces/primeng/issues/14083) + ## [16.4.1](https://github.com/primefaces/primeng/tree/16.4.1) (2023-09-27) [Full Changelog](https://github.com/primefaces/primeng/compare/16.4.0...16.4.1) @@ -400,6 +442,14 @@ - Checkbox in p-treeNode always checked when using custom icon [\#12951](https://github.com/primefaces/primeng/issues/12951) - ConfirmDialog: Duplicated AcceptIcons [\#13001](https://github.com/primefaces/primeng/issues/13001) +## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.12-LTS](https://www.npmjs.com/package/primeng/v/15.4.12-lts) (2023-11-08) + +**Fixed bugs:** +- Overlay: p-overlay div not removed from DOM on hiding panel [\#12948](https://github.com/primefaces/primeng/issues/12948) +- Table / EditableColumn: onEditComplete emitts old data value and not the new one as documented [\#13708](https://github.com/primefaces/primeng/issues/13708) +- FileUpload: Input Triggered on Any Mouse Click [\#13722](https://github.com/primefaces/primeng/issues/13722) +- Dialog: bad drag behavior when keepInViewport is false [\#13856](https://github.com/primefaces/primeng/issues/13856) + ## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.11-LTS](https://www.npmjs.com/package/primeng/v/15.4.11-lts) (2023-10-19) **Fixed bugs:** - Password | Incorrect placement of close icon when [toggleMask]="true" [\#13817](https://github.com/primefaces/primeng/issues/13817) @@ -678,6 +728,14 @@ - Sidebar: Footer Templating [\#12259](https://github.com/primefaces/primeng/issues/12259) - Calendar: Day names don't update [\#12148](https://github.com/primefaces/primeng/issues/12148) +## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [14.2.15-LTS](https://www.npmjs.com/package/primeng/v/14.2.15-lts) (2023-11-08) + +**Fixed bugs:** +- Overlay: p-overlay div not removed from DOM on hiding panel [\#12948](https://github.com/primefaces/primeng/issues/12948) +- Table / EditableColumn: onEditComplete emitts old data value and not the new one as documented [\#13708](https://github.com/primefaces/primeng/issues/13708) +- FileUpload: Input Triggered on Any Mouse Click [\#13722](https://github.com/primefaces/primeng/issues/13722) +- Dialog: bad drag behavior when keepInViewport is false [\#13856](https://github.com/primefaces/primeng/issues/13856) + ## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [14.2.14-LTS](https://www.npmjs.com/package/primeng/v/14.2.14-lts) (2023-10-19) **Fixed bugs:** - Password | Incorrect placement of close icon when [toggleMask]="true" [\#13817](https://github.com/primefaces/primeng/issues/13817) diff --git a/README.md b/README.md index 145c040e660..ed90a6de0bb 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![npm downloads](https://img.shields.io/npm/dm/primeng.svg)](https://www.npmjs.com/package/primeng) [![Actions CI](https://github.com/primefaces/primeng/workflows/NodeJS%20CI/badge.svg)](https://github.com/primefaces/primeng/actions/workflows/node.js.yml) [![Discord Chat](https://img.shields.io/discord/557940238991753223.svg?color=7289da&label=chat&logo=discord)](https://discord.gg/gzKFYnpmCY) +[![Discussions](https://img.shields.io/github/discussions-search?query=org%3Aprimefaces&logo=github&label=Prime%20Discussions&link=https%3A%2F%2Fgithub.com%2Forgs%2Fprimefaces%2Fdiscussions)](https://github.com/orgs/primefaces/discussions) [![PrimeNG Hero](https://www.primefaces.org/static/social/primeng-preview.jpg)](https://primeng.org) diff --git a/package.json b/package.json index 8fe5ad58605..9eafe7a3c2a 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "primeng", - "version": "16.7.0", + "version": "16.7.2", "license": "SEE LICENSE IN LICENSE.md", "scripts": { "ng": "ng", diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index 07cfcf70bae..39f8dc3eba1 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -183,7 +183,7 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = { { + this.hide(); + }, this.delay / 2); } else { if (query.length >= this.minLength) { this.focusedOptionIndex.set(-1); @@ -1240,6 +1242,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr this.changeFocusedOptionIndex(event, optionIndex); event.preventDefault(); + event.stopPropagation(); } onArrowUpKey(event) { @@ -1260,6 +1263,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr this.changeFocusedOptionIndex(event, optionIndex); event.preventDefault(); + event.stopPropagation(); } } @@ -1566,7 +1570,26 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr onOverlayAnimationStart(event: AnimationEvent) { if (event.toState === 'visible') { this.itemsWrapper = DomHandler.findSingle(this.overlayViewChild.overlayViewChild?.nativeElement, this.virtualScroll ? '.p-scroller' : '.p-autocomplete-panel'); - this.virtualScroll && this.scroller?.setContentEl(this.itemsViewChild?.nativeElement); + + if(this.virtualScroll) { + this.scroller?.setContentEl(this.itemsViewChild?.nativeElement); + this.scroller.viewInit(); + } + if(this.visibleOptions() && this.visibleOptions().length) { + if(this.virtualScroll) { + const selectedIndex = this.modelValue() ? this.focusedOptionIndex() : -1; + + if (selectedIndex !== -1) { + this.scroller?.scrollToIndex(selectedIndex); + } + } else { + let selectedListItem = DomHandler.findSingle(this.itemsWrapper, '.p-autocomplete-item.p-highlight'); + + if (selectedListItem) { + selectedListItem.scrollIntoView({ block: 'nearest', inline: 'center' }); + } + } + } } } diff --git a/src/app/components/chips/chips.ts b/src/app/components/chips/chips.ts index 918ef706cd2..617267f1f2f 100755 --- a/src/app/components/chips/chips.ts +++ b/src/app/components/chips/chips.ts @@ -84,7 +84,7 @@ export const CHIPS_VALUE_ACCESSOR: any = { (paste)="onPaste($event)" (focus)="onInputFocus($event)" (blur)="onInputBlur($event)" - [disabled]="disabled || maxedOut" + [disabled]="disabled || isMaxedOut" [ngStyle]="inputStyle" [class]="inputStyleClass" /> @@ -101,7 +101,7 @@ export const CHIPS_VALUE_ACCESSOR: any = { host: { class: 'p-element p-inputwrapper', '[class.p-inputwrapper-filled]': 'filled', - '[class.p-inputwrapper-focus]': 'focus', + '[class.p-inputwrapper-focus]': 'focused', '[class.p-chips-clearable]': 'showClear' }, providers: [CHIPS_VALUE_ACCESSOR], @@ -263,7 +263,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor { return this.focusedIndex !== null ? `${this.id}_chips_item_${this.focusedIndex}` : null; } - private get isValueMaxLimited(): boolean { + get isMaxedOut(): boolean { return this.max && this.value && this.max === this.value.length; } @@ -459,7 +459,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor { this.value = this.value || []; if (item && item.trim().length) { - if ((this.allowDuplicate || this.value.indexOf(item) === -1) && !this.isValueMaxLimited) { + if ((this.allowDuplicate || this.value.indexOf(item) === -1) && !this.isMaxedOut) { this.value = [...this.value, item]; this.onModelChange(this.value); this.onAdd.emit({ @@ -500,7 +500,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor { break; case 'Enter': - if (inputValue && inputValue.trim().length && !this.maxedOut()) { + if (inputValue && inputValue.trim().length && !this.isMaxedOut) { this.addItem(event, inputValue, true); } @@ -530,7 +530,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor { updateMaxedOut(): void { if (this.inputViewChild && this.inputViewChild.nativeElement) { - if (this.isValueMaxLimited) { + if (this.isMaxedOut) { // Calling `blur` is necessary because firefox does not call `onfocus` events // for disabled inputs, unlike chromium browsers. this.inputViewChild.nativeElement.blur(); @@ -544,10 +544,6 @@ export class Chips implements AfterContentInit, ControlValueAccessor { } } } - - maxedOut(): boolean { - return this.max && this.value && this.max === this.value.length; - } } @NgModule({ diff --git a/src/app/components/confirmdialog/confirmdialog.ts b/src/app/components/confirmdialog/confirmdialog.ts index c7a22811e5a..3e7f3e3d34d 100755 --- a/src/app/components/confirmdialog/confirmdialog.ts +++ b/src/app/components/confirmdialog/confirmdialog.ts @@ -283,7 +283,7 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy { * Element to receive the focus when the dialog gets visible. * @group Props */ - @Input() defaultFocus: 'accept' | 'reject' | 'close' = 'accept'; + @Input() defaultFocus: 'accept' | 'reject' | 'close' | 'none' = 'accept'; /** * Object literal to define widths per screen size. * @group Props diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index def24c8f083..40bfc366306 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -731,7 +731,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { this.lastPageX = event.pageX; this.container.style.left = `${leftPos}px`; this.lastPageY = event.pageY; - this.container.style.top = `${leftPos}px`; + this.container.style.top = `${topPos}px`; } } } diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index dd58cea843d..b3da382f5b2 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -146,9 +146,11 @@ export class DropdownItem { (blur)="onInputBlur($event)" (keydown)="onKeyDown($event)" > - {{ label() === 'p-emptylabel' ? ' ' : label() || 'empty' }} + {{ label() === 'p-emptylabel' ? ' ' : label() }} - {{ placeholder || 'empty' }} + + {{ label() === 'p-emptylabel' ? ' ' : placeholder }} + option.toLowerCase().indexOf(this._filterValue().toLowerCase()) !== -1) + : this.filterService.filter(options, this.searchFields(), this._filterValue(), this.filterMatchMode, this.filterLocale); if (this.group) { const optionGroups = this.options || []; const filtered = []; @@ -890,23 +896,15 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV return this.flatOptions(filtered); } - return filteredOptions; } return options; }); label = computed(() => { - let selectedOptionIndex; + const selectedOptionIndex = this.findSelectedOptionIndex(); - if (this.autoDisplayFirst) { - selectedOptionIndex = this.findFirstOptionIndex(); - } - if (!this.autoDisplayFirst) { - selectedOptionIndex = this.findSelectedOptionIndex(); - } - - return this.modelValue() ? this.getOptionLabel(this.modelValue()) : selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions()[selectedOptionIndex]) : this.placeholder || 'p-emptylabel'; + return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions()[selectedOptionIndex]) : this.placeholder || 'p-emptylabel'; }); constructor(public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, public zone: NgZone, public filterService: FilterService, public config: PrimeNGConfig) { @@ -1030,15 +1028,16 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } if (this.autoDisplayFirst && !this.modelValue()) { const ind = this.findFirstOptionIndex(); - this.onOptionSelect(null, this.visibleOptions()[ind], false); + this.onOptionSelect(null, this.visibleOptions()[ind], false, true); } } - onOptionSelect(event, option, isHide = true) { + onOptionSelect(event, option, isHide = true, preventChange = false) { const value = this.getOptionValue(option); this.updateModel(value, event); this.focusedOptionIndex.set(this.findSelectedOptionIndex()); isHide && this.hide(true); + (preventChange === false) && this.onChange.emit({originalEvent: event, value: value}); } onOptionMouseEnter(event, index) { @@ -1048,13 +1047,26 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } updateModel(value, event?) { + this.value = value; this.onModelChange(value); this.modelValue.set(value); this.selectedOptionUpdated = true; - this.onChange.emit({ - originalEvent: event, - value: value - }); + } + + writeValue(value: any): void { + if (this.filter) { + this.resetFilter(); + } + this.value = value; + + this.allowModelChange() && this.onModelChange(value); + this.modelValue.set(this.value) + this.updateEditableLabel(); + this.cd.markForCheck(); + } + + allowModelChange(){ + return this.autoDisplayFirst && !this.placeholder && !this.modelValue() && !this.editable && this.options && this.options.length; } isSelected(option) { @@ -1078,7 +1090,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } getOptionLabel(option: any) { - return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option && option.label !== undefined ? option.label : option; + return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option && option?.label !== undefined ? option.label : option; } getOptionValue(option: any) { @@ -1112,17 +1124,6 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV return this.visibleOptions().filter((option) => !this.isOptionGroup(option)).length; } - writeValue(value: any): void { - if (this.filter) { - this.resetFilter(); - } - - this.value = this.modelValue(); - this.updateModel(this.value); - this.updateEditableLabel(); - this.cd.markForCheck(); - } - /** * Callback to invoke on filter reset. * @group Method @@ -1176,6 +1177,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV this.onModelChange(value); this.updateModel(value, event); + this.onChange.emit({originalEvent: event, value: value}) } /** * Displays the panel. @@ -1201,13 +1203,13 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV if (this.virtualScroll) { const selectedIndex = this.modelValue() ? this.focusedOptionIndex() : -1; if (selectedIndex !== -1) { - this.scroller?.scrollToIndex(0); + this.scroller?.scrollToIndex(selectedIndex); } } else { let selectedListItem = DomHandler.findSingle(this.itemsWrapper, '.p-dropdown-item.p-highlight'); if (selectedListItem) { - selectedListItem.scrollIntoView({ block: 'nearest', inline: 'center' }); + selectedListItem.scrollIntoView({ block: 'nearest', inline: 'nearest' }); } } } @@ -1260,7 +1262,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV onInputBlur(event: Event) { this.focused = false; - this.onBlur.emit(event); + (this.overlayVisible === false) && this.onBlur.emit(event); if (!this.preventModelTouched) { this.onModelTouched(); @@ -1418,10 +1420,11 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV scrollInView(index = -1) { const id = index !== -1 ? `${this.id}_${index}` : this.focusedOptionId; + if (this.itemsViewChild && this.itemsViewChild.nativeElement) { const element = DomHandler.findSingle(this.itemsViewChild.nativeElement, `li[id="${id}"]`); if (element) { - element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' }); + element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'nearest' }); } else if (!this.virtualScrollerDisabled) { setTimeout(() => { this.virtualScroll && this.scroller?.scrollToIndex(index !== -1 ? index : this.focusedOptionIndex()); @@ -1602,12 +1605,12 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } onFirstHiddenFocus(event) { - const focusableEl = event.relatedTarget === this.focusInputViewChild.nativeElement ? DomHandler.getFirstFocusableElement(this.overlayViewChild.el.nativeElement, ':not(.p-hidden-focusable)') : this.focusInputViewChild.nativeElement; + const focusableEl = event.relatedTarget === this.focusInputViewChild?.nativeElement ? DomHandler.getFirstFocusableElement(this.overlayViewChild.el.nativeElement, ':not(.p-hidden-focusable)') : this.focusInputViewChild.nativeElement; DomHandler.focus(focusableEl); } hasFocusableElements() { - return DomHandler.getFocusableElements(this.overlayViewChild.overlayViewChild.nativeElement, ':not(.p-hidden-focusable)').length > 0; + return DomHandler.getFocusableElements(this.overlayViewChild?.overlayViewChild?.nativeElement, ':not(.p-hidden-focusable)').length > 0; } onBackspaceKey(event: KeyboardEvent, pressedInInputText = false) { @@ -1691,8 +1694,9 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } clear(event: Event) { - this.updateModel(event, null); + this.updateModel(null, event); this.updateEditableLabel(); + this.onChange.emit({originalEvent: event, value: this.value}) this.onClear.emit(event); } } diff --git a/src/app/components/fileupload/fileupload.ts b/src/app/components/fileupload/fileupload.ts index 4915f03dd72..aad352517e8 100755 --- a/src/app/components/fileupload/fileupload.ts +++ b/src/app/components/fileupload/fileupload.ts @@ -121,7 +121,7 @@ import { FileBeforeUploadEvent, FileProgressEvent, FileRemoveEvent, FileSelectEv [ngClass]="{ 'p-button p-component p-fileupload-choose': true, 'p-button-icon-only': !basicButtonLabel, 'p-fileupload-choose-selected': hasFiles(), 'p-focus': focus, 'p-disabled': disabled }" [ngStyle]="style" [class]="styleClass" - (mouseup)="onBasicUploaderClick()" + (click)="onBasicUploaderClick()" (keydown)="onBasicKeydown($event)" tabindex="0" pRipple @@ -743,15 +743,22 @@ export class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDe } isFileLimitExceeded() { - if (this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount && this.focus) { + const isAutoMode = this.auto; + const totalFileCount = isAutoMode ? this.files.length : this.files.length + this.uploadedFileCount; + + if (this.fileLimit && this.fileLimit <= totalFileCount && this.focus) { this.focus = false; } - return this.fileLimit && this.fileLimit < this.files.length + this.uploadedFileCount; + return this.fileLimit && this.fileLimit < totalFileCount; } isChooseDisabled() { - return this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount; + if (this.auto) { + return this.fileLimit && this.fileLimit <= this.files.length; + } else { + return this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount; + } } checkFileLimit() { diff --git a/src/app/components/image/image.ts b/src/app/components/image/image.ts index 225844f734e..516b2c7ce3a 100755 --- a/src/app/components/image/image.ts +++ b/src/app/components/image/image.ts @@ -23,7 +23,7 @@ import { FocusTrapModule } from 'primeng/focustrap'; template: ` -