Skip to content

Commit

Permalink
Use title in place of examples
Browse files Browse the repository at this point in the history
The `title` property is rendered by VJSF as dimmed placeholder text
inside the field itself, which is a subtle but clear hint to the user to
format the name correctly. This is simpler and less obtrusive than using
`examples`, which causes VJSF to instead render a dropdown menu
containing the examples. This prevents editing of an existing name and
implies that the example names are the only suggested names in the
system.
  • Loading branch information
waxlamp committed Dec 10, 2024
1 parent 9812ced commit 6bafca4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dandischema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,10 @@ class Person(Contributor):
json_schema_extra={"nskey": "schema"},
)
name: str = Field(
title="Lovelace, Augusta Ada",
description="Use the format: familyname, given names ...",
pattern=NAME_PATTERN,
json_schema_extra={"nskey": "schema"},
examples=["Lovelace, Augusta Ada", "Smith, John", "Chan, Kong-sang"],
)
affiliation: Optional[List[Affiliation]] = Field(
None,
Expand Down

0 comments on commit 6bafca4

Please sign in to comment.