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

Click event should include access to thing being clicked #4729

Closed
BeksOmega opened this issue Mar 24, 2021 · 2 comments
Closed

Click event should include access to thing being clicked #4729

BeksOmega opened this issue Mar 24, 2021 · 2 comments
Assignees
Labels
component: events issue: feature request Describes a new feature and why it should be added needs more info Waiting for developer response

Comments

@BeksOmega
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Recently there was a person on the forums that wanted to trigger an alert when one of their custom blocks was clicked. I think that ideally you should be able to do this by listening to the click event. But currently it is not possible to check what block a click occured on (so their alert would trigger regardless of whether it was their custom block or a different block).

Describe the solution you'd like

Since click is a UI event which doesn't need to be serialized, I think the element being clicked (eg field, block, or workspace) should be passed along with the event.

Describe alternatives you've considered

Information to reference the element being clicked could be passed. Eg, the block ID and field name in the case of a field click.

Additional context

N/A

@BeksOmega BeksOmega added issue: triage Issues awaiting triage by a Blockly team member issue: feature request Describes a new feature and why it should be added labels Mar 24, 2021
@alschmiedt alschmiedt added component: events and removed issue: triage Issues awaiting triage by a Blockly team member labels Mar 25, 2021
@alschmiedt alschmiedt added this to the Bug Bash Backlog milestone Mar 25, 2021
@moniika
Copy link
Contributor

moniika commented Apr 7, 2021

The Click event has the property blockId that can be used to access the block that is being clicked.
Does that solve the issue or is there something else that's missing?

@moniika moniika added the needs more info Waiting for developer response label Apr 7, 2021
@moniika moniika self-assigned this Apr 7, 2021
@BeksOmega
Copy link
Collaborator Author

The Click event has the property blockId that can be used to access the block that is being clicked.
Does that solve the issue or is there something else that's missing?

Haha I totally forgot about the common event properties. I think that solves it! Thank you =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: events issue: feature request Describes a new feature and why it should be added needs more info Waiting for developer response
Projects
None yet
Development

No branches or pull requests

3 participants