From 3dd054b29845740ba449bd9fceaaba7b349a9f27 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Wed, 25 Dec 2024 12:44:14 +0300 Subject: [PATCH] fix create option trait --- src/traits/CreateOption.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/traits/CreateOption.php b/src/traits/CreateOption.php index ffc3f15..d0b5190 100755 --- a/src/traits/CreateOption.php +++ b/src/traits/CreateOption.php @@ -19,7 +19,11 @@ trait CreateOption } } else { foreach ($options as $val => $title) { - $selected = (int)$value === $val ? "selected" : ""; + if (is_numeric($value)) { + $selected = (int)$value === $val ? "selected" : ""; + } else { + $selected = $value === $val ? "selected" : ""; + } $optionsString .= ""; } }