Skip to content

Commit

Permalink
BUGFIX: SingleSelect - if a search term is entered and there are sear…
Browse files Browse the repository at this point in the history
…ch results, these should be shown
  • Loading branch information
skurfuerst committed Jan 23, 2024
1 parent 4281a3a commit af69e01
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ brew install yarn
Build the app:
```shell
./build.sh
./dev.sh setup
./dev.sh build
```
## Contribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export default () => WrappedComponent => {
const { isLoading, searchOptions } = this.state;

const config = Object.assign({}, this.props, this.state);
const componentOptions = options.multiple || value ? this.state.options : searchOptions;
// For single-select, we want to display the search results as long as there are results
const componentOptions = options.multiple ? this.state.options : ((isLoading || searchOptions.length) ? searchOptions : this.state.options);

return (
<WrappedComponent
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/LazyDataSource/Plugin.js

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions build.sh

This file was deleted.

55 changes: 55 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
############################## DEV_SCRIPT_MARKER ##############################
# This script is used to document and run recurring tasks in development. #
# #
# You can run your tasks using the script `./dev some-task`. #
# You can install the Sandstorm Dev Script Runner and run your tasks from any #
# nested folder using `dev some-task`. #
# https://github.com/sandstorm/Sandstorm.DevScriptRunner #
###############################################################################

set -e

######### TASKS #########

function clean() {
rm -Rf Resources/Private/JavaScript/LazyDataSource/node_modules
}

function setup() {
cd Resources/Private/JavaScript/LazyDataSource
yarn install
}

function watch() {
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
export NODE_OPTIONS=--openssl-legacy-provider

cd Resources/Private/JavaScript/LazyDataSource
yarn run watch
}

function build() {
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
export NODE_OPTIONS=--openssl-legacy-provider

cd Resources/Private/JavaScript/LazyDataSource
yarn run build
}


####### Utilities #######

_log_success() {
printf "\033[0;32m%s\033[0m\n" "${1}"
}
_log_warning() {
printf "\033[1;33m%s\033[0m\n" "${1}"
}
_log_error() {
printf "\033[0;31m%s\033[0m\n" "${1}"
}

# THIS NEEDS TO BE LAST!!!
# this will run your tasks
"$@"

0 comments on commit af69e01

Please sign in to comment.