Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tx-techno-num
impactometre
Commits
a6ca545e
Commit
a6ca545e
authored
Dec 06, 2020
by
Elouan Le Bars
Browse files
[ADD] Select input on focus
parent
648c5e02
Changes
1
Hide whitespace changes
Inline
Side-by-side
front/src/components/IncrementButton.vue
View file @
a6ca545e
...
...
@@ -12,6 +12,7 @@
-
</button>
<input
@
focus=
"$event.target.select()"
type=
"text"
name=
"increment-button-value"
v-bind:value=
"value"
...
...
@@ -83,15 +84,20 @@ export default {
this
.
interval
=
false
;
},
input
:
function
(
event
)
{
if
(
parseInt
(
event
.
target
.
value
)
>
this
.
min
)
{
this
.
$emit
(
"
input
"
,
parseInt
(
event
.
target
.
value
));
var
value
=
parseInt
(
event
.
target
.
value
);
if
(
value
>
this
.
min
)
{
this
.
newValue
=
value
this
.
$emit
(
"
input
"
,
value
);
}
else
{
this
.
newValue
=
this
.
min
this
.
$emit
(
"
input
"
,
this
.
min
);
event
.
target
.
value
=
this
.
min
;
}
if
(
parseInt
(
event
.
target
.
value
)
<
this
.
max
)
{
this
.
$emit
(
"
input
"
,
parseInt
(
event
.
target
.
value
));
this
.
newValue
=
value
this
.
$emit
(
"
input
"
,
value
);
}
else
{
this
.
newValue
=
this
.
max
this
.
$emit
(
"
input
"
,
this
.
max
);
event
.
target
.
value
=
this
.
max
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment