Open gavinsbtm opened 2 years ago
Adding an ID to a button element using chainable id method is ignored.
Eg: Form::button('Upload')->id('upload-btn')
Output is: <button type="button" class="btn btn-primary">Upload</button>
<button type="button" class="btn btn-primary">Upload</button>
Expected output: <button id="upload-btn" type="button" class="btn btn-primary">Upload</button>
<button id="upload-btn" type="button" class="btn btn-primary">Upload</button>
Changing renderButton() function in FormBuilder.php fixes this:
private function renderButton(): string { extract($this->get('id', 'type', 'value', 'disabled')); $class = $this->getBtnAnchorClasses(); $attrs = $this->buildHtmlAttrs(['id' => $id, 'type' => $type, 'class' => $class, 'disabled' => $disabled]); return '<button ' . $attrs . '>' . $value . '</button>'; }
Adding an ID to a button element using chainable id method is ignored.
Eg: Form::button('Upload')->id('upload-btn')
Output is:
<button type="button" class="btn btn-primary">Upload</button>
Expected output:
<button id="upload-btn" type="button" class="btn btn-primary">Upload</button>
Changing renderButton() function in FormBuilder.php fixes this: