Skip to content

Commit

Permalink
Add onkeypress property
Browse files Browse the repository at this point in the history
  • Loading branch information
muath-ye committed Aug 3, 2022
1 parent cd6bdc9 commit b43b7b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions resources/views/components/forms/string-input.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{{ !isset($class) ?'': "class=$class" }}
{{ !isset($id) ?'': "id=$id" }}
{{ !isset($placeholder) ?'': "placeholder=$placeholder" }}
{{ !isset($onkeypress) ?'': "onkeypress=$onkeypress" }}
/>

<script>
Expand Down
6 changes: 5 additions & 1 deletion src/Components/Forms/StringInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class StringInput extends Component

public $placeholder = '';

public $onkeypress = '';

/**
* Create the component instance.
*
Expand All @@ -28,17 +30,19 @@ class StringInput extends Component
* @param string $id
* @param string $class
* @param string $placeholder
* @param string $onkeypress
* @param bool $is_repeated
* @return void
*/
public function __construct($name, $rules, $type = 'text', $id = '', $class = '', $placeholder = '')
public function __construct($name, $rules, $type = 'text', $id = '', $class = '', $placeholder = '', $onkeypress = '')
{
$this->name = $name;
$this->rules = $rules;
$this->type = $type;
$this->id = $id;
$this->class = $class;
$this->placeholder = $placeholder;
$this->onkeypress = $onkeypress;
}

/**
Expand Down

0 comments on commit b43b7b9

Please sign in to comment.