You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that substring should be checked. if host is not passed, it shouldn't deref a null. if host isn't passed, it should work right?
using import * as scrawl from "https://unpkg.com/[email protected]";
Exported function (to modules and scrawl object). Use addCanvas to add a Scrawl-canvas canvas element to a web page. The items argument should include
host - the host element, either as the DOM element itself, or some sort of CSS search string, or a Scrawl-canvas Stack entity. If no host is supplied, Scrawl-canvas will add the new canvas element to the DOM document body; in all cases, the new canvas element is appended at the end of the host element (or DOM document)
name - String identifier for the element; will generate a random name for the canvas if no name is supplied.
any other regular Scrawl-canvas Canvas artefact attribute
By default, Scrawl-canvas will setup the new Canvas as the ‘current canvas’, and will add mouse/pointer tracking functionality to it. If no dimensions are supplied then the Canvas will default to 300px wide and 150px high.
export const addCanvas = function (items = Ωempty) {
...
if (host.substring) { <-- **YOU USE HOST WITHOUT CHECKING HOST IS NOT NULL**
temphost = artefact[host];
if (!temphost && host) {
host = document.querySelector(host);
if (host) mygroup = host.id;
}
else host = temphost;
}
if (host) { <--- **YOU CHECK FOR HOST HERE.**
if (host.type === T_STACK) {
mygroup = host.name;
position = ABSOLUTE;
host = host.domElement;
}
else if (!isa_dom(host)) host = document.body;
}
else host = document.body;
...
};
I think that substring should be checked. if host is not passed, it shouldn't deref a null. if host isn't passed, it should work right?
using import * as scrawl from "https://unpkg.com/[email protected]";
#127
if (host && host.substring)
The text was updated successfully, but these errors were encountered: