P5.js: p5.Element.parent() should return p5.Element instance

Created on 17 Sep 2020  路  2Comments  路  Source: processing/p5.js

Most appropriate sub-area of p5.js?

  • DOM

Feature enhancement details:

p5.Element.prototype.child() and p5.Element.prototype.parent() should return p5.Element instance instead of returning HTML DOM node so that .show(), .hide() and other p5.Element functions can be called.

Current:

let btn = select("button");
new p5.Element(btn.parent()).hide();

Suggested:

let btn = select("button");
btn.parent().hide();

We won't be losing any functionality as DOM node can be accessed through btn.parent().elt.

enhancement

Most helpful comment

This is technically a breaking change so I wouldn't recommend changing the implementation at this point.

All 2 comments

Welcome! 馃憢 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

This is technically a breaking change so I wouldn't recommend changing the implementation at this point.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Patchy12 picture Patchy12  路  3Comments

aferriss picture aferriss  路  3Comments

sps014 picture sps014  路  3Comments

b0nb0n picture b0nb0n  路  3Comments

aman-tiwari picture aman-tiwari  路  3Comments