SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.58k stars 270 forks source link

Add Ui5CustomEvent for UploadCollectionItem on rename cancel click #9704

Open tkeiner opened 3 months ago

tkeiner commented 3 months ago

Is your feature request related to a problem?

The UploadCollectionItem has a custom event that is fired when the attachment is renamed. However, there is no event for when the rename is cancelled. Currently I have to access the item via the querySelector and add an EventListener. This approach works but is not ideal.

Describe the solution you'd like

It would be great if the web components could also provide a custom event in case the rename is cancelled.

Describe alternatives you've considered

No response

Additional Context

No response

Organization

No response

Declaration

MarcusNotheis commented 3 months ago

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

yanaminkova commented 3 months ago

Hello @SAP/ui5-webcomponents-topic-rd ,

Could you please review this feature request and assess whether it's worth considering for implementation?

Thanks and Best regards, Yana

dimovpetar commented 3 weeks ago

Hello @tkeiner ,

In this case nothing changes, the file name remains the same. Please justify what would be the benefit of such event? Can you share your intended use case?

Best regards, Petar

tkeiner commented 3 weeks ago

Hi @dimovpetar, There is a use case for this, which is to extend the edit functionality of the upload collection item. In our case, it was to add an input field to allow users to add additional information, when the rename is active.

I understand that this is an edge case, and I understand that this approach may not align with the web component strategy. Also, our use case could be implemented by querying for the required button and adding a listener. Having a dedicated event for the state of the rename (rename started, rename canceled, renamed) would have been nice to improve our code quality, which is the reason I opened the feature request.

Regards, Tobias

dimovpetar commented 3 weeks ago

Hello @tkeiner ,

Please edit this Stackblitz https://stackblitz.com/edit/js-vsrpnb?file=index.js,index.html to show your example. We will then evaluate your request. Adding event listener to elements in the shadow root is not supported and most likely won't work in the future.

Best regards, Petar

tkeiner commented 3 weeks ago

Would it be fine if I create a Stackblitz with ui5 web components for React? I am more comfortable with React.

dimovpetar commented 3 weeks ago

Would it be fine if I create a Stackblitz with ui5 web components for React? I am more comfortable with React.

Sure, it's fine :)

github-actions[bot] commented 5 days ago

Hello, everyone! The issue has been inactive for 21 days. If there are still questions or comments, please feel free to continue the discussion. Inactive issues will be closed after 7 days!