Skip to main content
Version: Current (v7.0.0-beta.3)

An extra key renders as a dropdown when propertyNames has an enum

Detect​

  • In your schema, an object with additionalProperties or patternProperties whose propertyNames has an enum of key names:
import { RJSFSchema } from '@rjsf/utils';

const schema: RJSFSchema = {
type: 'object',
additionalProperties: { type: 'boolean' },
propertyNames: { enum: ['darkMode', 'betaBanner', 'offlineCache'] },
};
  • In your tests or CSS, selectors that find the key's text input. In every theme the rendered page now shows a select there.

Change​

Update tests and styles to work with the select. A name another key already holds is left out of its options, and the add button creates the new property under the first allowed name that is still free instead of newKey, so update tests that expect newKey.

Verify​

Also read: