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

ShimEvent doesn't have preventDefault method #253

Closed
xlc opened this issue Jun 23, 2016 · 6 comments
Closed

ShimEvent doesn't have preventDefault method #253

xlc opened this issue Jun 23, 2016 · 6 comments
Milestone

Comments

@xlc
Copy link

xlc commented Jun 23, 2016

I am using IndexedDBShim and sklad and got this error on iPad running iOS 8 & 9:

Error: TypeError: evt.preventDefault is not a function. (In 'evt.preventDefault()', 'evt.preventDefault' is undefined)

In this function:

openConnRequest.onerror = function (evt) {
        if (isResolvedOrRejected) {
            return;
        }

        evt.preventDefault();
        reject(ensureError(evt.target.error));

        isResolvedOrRejected = true;
    };

ShimEvent should have preventDefault method and other methods on Event object.

@brettz9
Copy link
Collaborator

brettz9 commented Jun 25, 2016

This also interconnects with #229 and #241

@brettz9
Copy link
Collaborator

brettz9 commented Jul 13, 2016

FYI, I've added support for addEventListener and other EventTarget features via my fork of eventdispatcher.js and although the fork supports preventDefault (as with bubbling), I haven't yet taken advantage of it within IndexedDBShim, so calling it on the code in master will not throw but will currently have no effect. I intend to implement though, so can let you know when it may be ready.

@brettz9 brettz9 added this to the 3.0.0 milestone Oct 18, 2016
@brettz9
Copy link
Collaborator

brettz9 commented Oct 26, 2016

This is now supported in master. Looking to finish the following though until ready for a release: #262 (comment)

@brettz9 brettz9 closed this as completed Oct 26, 2016
@brettz9
Copy link
Collaborator

brettz9 commented Oct 27, 2016

Actually, I neglected to notice you were asking about preventing within an open request--the versionchange/upgradeneeded (and when ready, blocked and closed) ought to support all of EventTarget, but currently that is not ready or reviewed, so I will reopen, but the normal request->transaction->connection->window.onerror support has been added.

@brettz9 brettz9 reopened this Oct 27, 2016
@brettz9
Copy link
Collaborator

brettz9 commented Oct 27, 2016

The AbortError error firing on IDBOpenDBRequest requests (which aborted or were closed) is now done in master. There are some tangential matters which are not complete (e.g., upgradeneeded reversions), but the bubbling work is complete.

Note that your preventDefault should now have no effect (as per point 3.2.1 of this section of the spec).

@brettz9 brettz9 closed this as completed Oct 27, 2016
@brettz9
Copy link
Collaborator

brettz9 commented Apr 21, 2017

FWIW, the ugpradeneeded reversions are applied where possible (esp. in Node where we can prolong a transaction).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants