ember-native-dom-helpers icon indicating copy to clipboard operation
ember-native-dom-helpers copied to clipboard

'selectFiles' Not working when calling twice

Open raphaelns-developer opened this issue 7 years ago • 2 comments

When i try to use the selectFiles helper twice in the same input this erro ocour: TypeError: Cannot redefine property: files at Function.defineProperty (<anonymous>) at buildFileEvent (fire-event.js:190) at fireEvent (fire-event.js:50) ...

raphaelns-developer avatar Jan 31 '18 00:01 raphaelns-developer

I was able to fix the problem just addin the files attribute before calling the selectFiles helper, but adding the configurable option to allow the attribute to be changed. Object.defineProperty(find(${selector} [data-test-input-file]), 'files', { value: {}, configurable: true });

raphaelns-developer avatar Jan 31 '18 00:01 raphaelns-developer

I was also experiencing this with @ember/test-helpers https://github.com/emberjs/ember-test-helpers/pull/326

amk221 avatar Feb 15 '18 15:02 amk221