Skip to content

Commit

Permalink
[4.x] Fix Bard sets being inserted too early (#9216)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Jan 16, 2024
1 parent 4445c17 commit f454424
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion resources/js/components/fieldtypes/bard/BardFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,16 @@ export default {
this.updateSetMeta(id, this.meta.new[handle]);
const { $head } = this.editor.view.state.selection;
const { nodeBefore } = $head;
// Perform this in nextTick because the meta data won't be ready until then.
this.$nextTick(() => {
this.editor.commands.set({ id, values });
if (nodeBefore) {
this.editor.commands.setAt({ attrs: { id, values }, pos: $head.pos });
} else {
this.editor.commands.set({ id, values });
}
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/Facades/Endpoint/Pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function sqlLikeQuote(string $like): string
/**
* Converts SQL LIKE syntax to a regular expression.
*
* @return string The regular expression without delimiters.
* @return string The regular expression without delimiters.
*/
public function sqlLikeToRegex(string $like): string
{
Expand Down
4 changes: 2 additions & 2 deletions src/Modifiers/CoreModifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ public function joinplode($value, $params)
/**
* Check if an item exists in an array using "dot" notation.
*
* @param $value
* @param $value
* @return bool
*/
public function inArray($haystack, $params, $context)
Expand Down Expand Up @@ -1493,7 +1493,7 @@ public function merge($value, $params, $context)
/**
* Generate an md5 hash of a value.
*
* @param $params
* @param $params
* @return string
*/
public function md5($value)
Expand Down

0 comments on commit f454424

Please sign in to comment.