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

Field Cursor Configuration #2885

Closed
BeksOmega opened this issue Aug 20, 2019 · 1 comment
Closed

Field Cursor Configuration #2885

BeksOmega opened this issue Aug 20, 2019 · 1 comment
Labels
component: fields issue: feature request Describes a new feature and why it should be added

Comments

@BeksOmega
Copy link
Collaborator

BeksOmega commented Aug 20, 2019

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

It is currently unclear if you should, and how you can change the cursor for fields.

E.g:

  • Can/Should you change the cursor of a field type?
  • Can/Should you change the cursor of a field instance?
  • Can/Should you change it dynamically (e.g. based on if the field is editable)?

Describe the solution you'd like

I think it would be the most flexible to say yes to all three.

  • Some CURSOR properties already exist on field subclasses. One could also be added to the abstract field class. That way you won't have to dig through the css to figure out what the default cursor is.
  • Add a cursor property to the opt_config of the abstract field class. This would allow it to also be passed through the JSON Definition.
  • Add a setCursor function that allows the cursor to be changed dynamically.

Describe alternatives you've considered

  • No to all three.
  • No to some and yes to some.

The abstract field class should maybe get a CURSOR property anyway though, for consistency.

Additional context

I've seen people setting the CURSOR property of field instances directly (on the forums), so I think there is demand for this.

This could also be handled by CSS instead of programmatically. Related: #2884

@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 Aug 20, 2019
@alschmiedt alschmiedt added component: fields and removed issue: triage Issues awaiting triage by a Blockly team member labels Aug 28, 2019
@alschmiedt alschmiedt added this to the Needs discussion milestone Aug 28, 2019
@samelhusseini
Copy link
Contributor

I would generally learn towards letting developers use CSS to configure properties that are simply being set in JS on the field element, but given the legacy of this property I'm not opposed to doing all of the above.

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

No branches or pull requests

4 participants