foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
192 stars 10 forks source link

Support `hint` option for `choices` of `DataField` #10794

Open dev7355608 opened 2 weeks ago

dev7355608 commented 2 weeks ago
mode: new foundry.data.fields.NumberField({
    choices: Object.fromEntries(Object.entries(MODES)
        .map(([key, value]) => [value, {
            label: `MODES.${key}.label`,
            hint: `MODES.${key}.hint`
        }]))
})

The hint could be displayed as a tooltip on the select element or on the tags if multiselect. image

aaclayton commented 2 weeks ago

@Feu-Secret had mentioned something similar, perhaps concatenating the hint text for the currently chosen option with the hint text for the field itself.