Skip to content

Options object not included in the event object for the change event for file selector. #146

@simpleclicks

Description

@simpleclicks

When I send in the options through the trigger event for the 'change' event on the file input selector, buildFileEvent gets called and the function does not include the options with the event object returned.

function buildFileEvent(type, element, files = []) {
  let event = buildBasicEvent(type);

  if (files.length > 0) {
    Object.defineProperty(files, 'item', {
      value(index) {
        return typeof index === 'number' ? this[index] : null;
      }
    });
    Object.defineProperty(element, 'files', {
      value: files
    });
  }

  Object.defineProperty(event, 'target', {
    value: element
  });

  return event;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions