Skip to content

Commit

Permalink
Fix preload and openOnFocus options behavior for TomSelectRemote comp…
Browse files Browse the repository at this point in the history
…onent (#539)
  • Loading branch information
rjaros committed Oct 16, 2024
1 parent 0eb061b commit 154069e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ open class TomSelectRemoteInput<out T : Any>(
} else null
this.tsCallbacks = tsCallbacks?.copy(load = loadCallback, shouldLoad = shouldLoadCallback)
?: TomSelectCallbacks(load = loadCallback, shouldLoad = shouldLoadCallback)
this.tsOptions = tsOptions?.copy(preload = preload, openOnFocus = openOnFocus, searchField = emptyList())
val forcedPreload = if (preload) true else tsOptions?.preload
val forcedOpenOnFocus = if (openOnFocus) true else tsOptions?.openOnFocus
this.tsOptions = tsOptions?.copy(preload = forcedPreload, openOnFocus = forcedOpenOnFocus, searchField = emptyList())
?: TomSelectOptions(
preload = preload,
openOnFocus = openOnFocus,
preload = forcedPreload,
openOnFocus = forcedOpenOnFocus,
searchField = emptyList()
)
this.tsRenders = tsRenders?.copy(option = ::renderOption, item = ::renderItem) ?: TomSelectRenders(
Expand Down

0 comments on commit 154069e

Please sign in to comment.