Dropdown box (type: 'select') appears empty when using {'value_1':'display_1','value_2':'display_2',...} in array options
darkred opened this issue · comments
I want to make a dropdown box (type: 'select'
) in GM_config (using Greasemonkey)
(in order to further modify this script).
This is the code:
GM_config.init('Settings',{
choice: { label: 'Choice:', section: ['Extras'], type: 'select', options: {'1':'Enhance','2': 'Hide', '3':'---'}, default: '1' }
},{
save: function(){location.reload();}});
and this is how it appears when clicking it:
P.S. For reference, the following works ok:
GM_config.init('Settings',{
enhanceVisibility: { label: 'Choice:', section: ['Extras'], type: 'select', options: ['Enhance','Hide', '----'], default: 'Enhance' }
},{
save: function(){location.reload();}});
You are using outdated documentation. Use the wiki. Here's the documentation for the select field type: https://github.com/sizzlemctwizzle/GM_config/wiki/Fields#select
Thank you for replying.