Skip to content

Commit

Permalink
Fix select config bug (wulkano#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
karaggeorge authored Aug 11, 2020
1 parent d27a921 commit 45591b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/entitlements.mac.inherit.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
</dict>
</plist>
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
"entitlements": "./build/entitlements.mac.inherit.plist",
"extendInfo": {
"NSMicrophoneUsageDescription": "Kap needs access to the microphone to be able to record audio for screen recordings.",
"NSCameraUsageDescription": "A Kap plugin wants to use the camera.",
"NSUserNotificationAlertStyle": "alert",
"CFBundleDocumentTypes": [
{
Expand Down
7 changes: 7 additions & 0 deletions renderer/components/config/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ const ConfigInput = ({name, type, schema, value, onChange, hasErrors}) => {

if (type === 'select') {
const options = schema.enum.map(value => ({label: value, value}));

if (!options.some(option => option.value === value)) {
const newValue = options[0] && options[0].value;
onChange(name, newValue);
return <Select full tabIndex={0} options={options} selected={newValue} onSelect={value => onChange(name, value)}/>;
}

return <Select full tabIndex={0} options={options} selected={value} onSelect={value => onChange(name, value)}/>;
}

Expand Down

0 comments on commit 45591b5

Please sign in to comment.