🐛 Fixed inability to create multi-word tags via post settings menu

closes https://github.com/TryGhost/Ghost/issues/9357
- detect space key being pressed and ignore in the token input's custom `selectOrCreate` action
This commit is contained in:
Kevin Ansfield 2018-01-02 13:54:02 +00:00
parent e64dc48d54
commit bdab644ad5

View File

@ -133,7 +133,13 @@ export default Component.extend({
return newOptions;
}),
selectOrCreate(selection, select) {
selectOrCreate(selection, select, keyboardEvent) {
// allow tokens to be created with spaces
if (keyboardEvent && keyboardEvent.code === 'Space') {
select.actions.search(`${select.searchText} `);
return;
}
let suggestion = selection.find((option) => {
return option.__isSuggestion__;
});