Skip to content

Make default sketch canvas ID autoincrement #7836

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

Open
wants to merge 1 commit into
base: dev-2.0
Choose a base branch
from

Conversation

limzykenneth
Copy link
Member

Resolves #7834

Changes:
There are two parts to this PR, the first is to not assign an ID to the canvas element if it already has an ID thereby preserving the user intended one.

The second part makes the default ID (assigned when the canvas don't already have an ID) to have an autoincrementing number. This is done so that if there are multiple sketches created by the user, they will not all be assigned the same ID which is technically not good practice (ID should be unique). However, I'm not sure if this is the right approach because I'm also thinking whether we should assign default ID's to sketch canvas at all.

We already add a class to the canvas so they can be collectively selected if needed while the ID along with the autoincrementing aspect makes the numbering potentially unstable and so may not be entirely reliable as a selector. The ID is not used internally and externally it probably shouldn't be relied on to be a specific value since the ID is something that the user can change. So another potential solution is to remove the sketch ID assignment entirely.

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

Successfully merging this pull request may close these issues.

1 participant