From 8dadcd22e0eb4fa9b09a862ddb60cf00cab88964 Mon Sep 17 00:00:00 2001 From: "Michael K. Ocansey" Date: Sat, 14 Sep 2024 16:39:20 +0000 Subject: [PATCH 1/2] Fix: #342 --- resources/views/components/input.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/components/input.blade.php b/resources/views/components/input.blade.php index 2c9dd65..2645b1d 100644 --- a/resources/views/components/input.blade.php +++ b/resources/views/components/input.blade.php @@ -153,7 +153,8 @@ $suffix_is_icon = true; $suffix_icon_css = 'hidden cursor-pointer dark:!bg-dark-900/60 dark:hover:!bg-dark-900 !p-0.5 !rounded-full bg-gray-400 !stroke-2 hover:bg-gray-600 text-white'; } - if($attributes->has('readonly', 'disabled')){ + + if($attributes->has('readonly') || $attributes->has('disabled')) { if($attributes->get('readonly') == 'false') $attributes = $attributes->except('readonly'); if($attributes->get('disabled') == 'false') $attributes = $attributes->except('disabled'); } From 01db7c0fe62cffb20b280ab78e573f5bf90919f7 Mon Sep 17 00:00:00 2001 From: "Michael K. Ocansey" Date: Mon, 16 Sep 2024 12:36:36 +0000 Subject: [PATCH 2/2] Removed die() if data keys are missing --- resources/views/components/select.blade.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/resources/views/components/select.blade.php b/resources/views/components/select.blade.php index b40489f..9e72e86 100644 --- a/resources/views/components/select.blade.php +++ b/resources/views/components/select.blade.php @@ -134,25 +134,14 @@ $filter = preg_replace('/[\s-]/', '_', $filter); $selected_value = ($selected_value != '') ? explode(',', str_replace(', ', ',', $selected_value)) : []; - if ($data !== 'manual' && count($data)) { + if ($data !== 'manual') { $data = (!is_array($data)) ? json_decode(str_replace('"', '"', $data), true) : $data; - - if(! isset($data[0][$label_key]) ) { - die('

- <x-bladewind.select />: ensure the value you set as label_key - exists in your array data

'); - } - - if( !empty($flag_key) && !isset($data[0][$flag_key]) ) { - die('

- <x-bladewind.select />: ensure the value you set as flag_key exists in your array

'); - } } $size = (!in_array($size, ['small','medium', 'regular', 'big'])) ? 'medium' : $size; $sizes = [ 'small' => 'py-[6px]', 'medium' => 'py-[10px]', 'regular' => 'py-[6.5px]', 'big' => 'py-[18.5px]' ]; @endphp -