Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorostoyanov committed Apr 22, 2021
2 parents 653a884 + ecfa451 commit 78002ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Define version constant
if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
define( __NAMESPACE__ . '\VERSION', '3.3.1' );
define( __NAMESPACE__ . '\VERSION', '3.3.2' );
}

# Define root directory
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "carbon-fields",
"version": "3.3.1",
"version": "3.3.2",
"description": "WordPress developer-friendly custom fields for post types, taxonomy terms, users, comments, widgets, options, navigation menus and more.",
"directories": {
"test": "tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { pull, fromPairs } from 'lodash';
*/
import { fromSelector } from '@carbon-fields/core';

const TAGS_DELIMITER = ',';

/**
* Applies a monkey patch to the specified method of `window.tagBox` API
* so we can detect changes of the non-hierarchical taxonomies.
Expand Down Expand Up @@ -81,7 +83,7 @@ function getTermsFromChecklist( taxonomy ) {
function getTermsFromText( taxonomy ) {
const node = document.querySelector( `#tagsdiv-${ taxonomy } textarea.the-tags` );
const terms = node.value
? node.value.split( window.tagsSuggestL10n.tagDelimiter )
? node.value.split( TAGS_DELIMITER )
: [];

return {
Expand Down Expand Up @@ -135,7 +137,7 @@ function trackNonHierarchicalTaxonomies() {
fromEvent( node.querySelector( 'textarea.the-tags' ), 'change' ),
map( ( { target } ) => ( {
[ taxonomy ]: target.value
? target.value.split( window.tagsSuggestL10n.tagDelimiter )
? target.value.split( TAGS_DELIMITER )
: []
} ) ),
startWith( getTermsFromText( taxonomy ) )
Expand Down

0 comments on commit 78002ea

Please sign in to comment.