Skip to content

Added tooltip support in schema properties. #521

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: master
Choose a base branch
from

Conversation

dmcallejo
Copy link

This allows the addition of more detailed descriptions for each property of the schema. Usage is as simple as adding a "tooltip" field into the property, as stated in the examples:

  "properties": {
     "name": {
       "type": "string",
       "description": "First and Last name",
       "tooltip": "First and last name of the simple person",
       "minLength": 4
     }, (...)

@jdorn
Copy link
Owner

jdorn commented Nov 19, 2015

I like the idea. A couple comments:

  • Move 'tooltip' under options since it isn't a standard JSON Schema keyword
{
  "type": "string",
  "minLength": 4,
  "options": {
    "tooltip": "This is a tooltip"
  }
}
  • Instead of adding another argument to getFormControl, I would create a new theme function addTooltip that takes a DOM node as an argument. That way it can be reused elsewhere and it will be easier for themes to override.
this.control = this.theme.getFormControl(this.label, this.input, this.description);
this.theme.addTooltip(this.control, this.tooltip);

@nipunarora
Copy link

has this item been merged in the base branch? I would really like this feature as well.

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.

4 participants