Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing HR in command palette #457

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chosak
Copy link

@chosak chosak commented Feb 22, 2023

When the command palette is built without a prescribed list of commands, the horizontal rule is added to the list of entity types, if it is configured via enableHorizontalRule. If the command palette is built by passing a list of commands, though, enableHorizontalRule is ignored and the HR is not added to the list of entity types.

This seems inadvertent and causes the HR to get dropped even if it has been configured. This seems to be the cause of wagtail/wagtail#9707, unless I am misunderstanding how this code is supposed to work.

The fix in Wagtail's bakerydemo:

Before After
image image

(Note: there is likely a DRYer way to implement this without repeating code from above, but my TypeScript skills are pretty basic. Any better suggestions would be appreciated!)

When the command palette is built without a prescribed list of
commands, the horizontal rule is added to the list of entity types,
if it is configured via enableHorizontalRule. If the command palette
is built by passing a list of commands, though, enableHorizontalRule is
ignored and the HR is not added to the list of entity types.

This seems inadvertent and causes the HR to get dropped even if it has
been configured. This seems to be the cause of
wagtail/wagtail#9707, unless I am
misunderstanding how this code is supposed to work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant