Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [PrizmFileUploadComponent] Некорректно работает метод clearFiles #1848

Closed
1 of 9 tasks
TheSpaceHuman opened this issue Jul 2, 2024 · 0 comments · Fixed by #1939 or #1952
Closed
1 of 9 tasks
Assignees
Labels
priority:urgently "Tag: priority:urgently — Marks tasks or issues that require immediate attention and action. These a source:idp issue from IDP state:ready ready for release (pass tested) type:bug Something isn't working
Milestone

Comments

@TheSpaceHuman
Copy link
Contributor

Библиотека

  • @prizm-ui/core
  • @prizm-ui/components
  • @prizm-ui/install
  • @prizm-ui/icons
  • @prizm-ui/flag-icons
  • @prizm-ui/theme
  • @prizm-ui/charts
  • @prizm-ui/ast
  • @prizm-ui/nx-plugin

Компонент

PrizmFileUploadComponent

Версия

Браузер:

Google Chrome Версия 126

Dependencies:

@prizm-ui/components 3.14.0

Описание проблемы

При вызове метода clearFiles с параметром { emitEvent: false } все равно происходит отправка в filesChange, чего происходить не должно. Проблема в том что данный параметр не прокидывает к циклу с вызовом removeFile.

Решение

public clearFiles(options: { emitEvent: boolean } = { emitEvent: true }): void {
  if (options.emitEvent) {
    this.beforeFilesChange.next();
  }
  
  for (const file of this.filesMap.keys()) {
    this.removeFile(file, {emitEvent: options.emitEvent });
  }
  
  if (options.emitEvent) {
    this.filesChange.next([]);
  }
}
 
@ickisIckis ickisIckis self-assigned this Jul 3, 2024
@ickisIckis ickisIckis added the type:bug Something isn't working label Jul 8, 2024
@ickisIckis ickisIckis added this to the 4.5.0 milestone Jul 24, 2024
@ickisIckis ickisIckis added the priority:urgently "Tag: priority:urgently — Marks tasks or issues that require immediate attention and action. These a label Jul 24, 2024
@ickisIckis ickisIckis modified the milestones: 4.5.0, 4.3.8 Aug 7, 2024
@ickisIckis ickisIckis added the state:ready ready for release (pass tested) label Aug 7, 2024
ZurabDev added a commit that referenced this issue Aug 9, 2024
fix(components/file-upload): emit events for clear files fix #1848
@ZurabDev ZurabDev mentioned this issue Aug 9, 2024
ickisIckis added a commit that referenced this issue Aug 12, 2024
fix(components/file-upload): emit events for clear files fix #1848
@bumalai bumalai added the source:idp issue from IDP label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:urgently "Tag: priority:urgently — Marks tasks or issues that require immediate attention and action. These a source:idp issue from IDP state:ready ready for release (pass tested) type:bug Something isn't working
Projects
None yet
3 participants