carbon-componentscarbon-components-reactDescribe in detail the issue you're having.
When removing a file from the file-uploader component by clicking its "x" button, the events eventBeforeDeleteFilenameFileuploader and eventAfterDeleteFilenameFileuploader are not emitted.
Is this issue related to a specific component?
file-uploader
What did you expect to happen? What happened instead? What would you like to
see changed?
I expected the events to be fired so I can respond to file removal by the user.
What browser are you working in?
Chrome
What version of the Carbon Design System are you using?
10.3.2
What offering/product do you work on? Any pressing ship or release dates we
should be aware of?
ICP4I Operations Dashboard
The problem is within the JS code.
Instead of calling changeState() the code is invoking _changeState(), which bypasses all standard event firing code of evented-state.
/**
* Handles delete button.
* @param {Event} evt The event triggering this action.
* @private
*/
_handleDeleteButton = evt => {
const target = eventMatches(evt, `[data-for=${this.inputId}]`);
if (target) {
///////////////// HERE vvv
this._changeState('delete-filename-fileuploader', {
///////////////// HERE ^^^
initialEvt: evt,
filenameElement: target.parentNode,
});
}
};
Hi 馃憢 thank you for reporting! I believe @emyarod is addressing this problem as part of #3175 - Stay tuned!
Most helpful comment
Hi 馃憢 thank you for reporting! I believe @emyarod is addressing this problem as part of #3175 - Stay tuned!