瀏覽代碼

重置 field width 为默认宽度

Edwin Xu 3 年之前
父節點
當前提交
4296879210
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/Form/Row.php

+ 3 - 3
src/Form/Row.php

@@ -96,7 +96,7 @@ class Row implements Renderable
      *
      * @var int
      */
-    protected $fieldWidth;
+    protected $fieldWidth = 12;
 
     /**
      * @var bool
@@ -204,11 +204,11 @@ class Row implements Renderable
         $field->horizontal($this->horizontal);
 
         $this->fields->push([
-            'width'   => $this->fieldWidth ?: $this->defaultFieldWidth,
+            'width'   => $this->fieldWidth,
             'element' => $field,
         ]);
 
-        unset($this->fieldWidth); // unset field width for next field
+        $this->fieldWidth = $this->defaultFieldWidth; // reset field width for next field
 
         return $field;
     }