Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
29278027
Commit
29278027
authored
May 17, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Focus the description field in the inline form when mounted
[ci skip]
parent
4fcff0bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
app/assets/javascripts/issue_show/components/fields/description.vue
.../javascripts/issue_show/components/fields/description.vue
+4
-1
spec/javascripts/issue_show/components/fields/description_spec.js
...ascripts/issue_show/components/fields/description_spec.js
+34
-0
No files found.
app/assets/javascripts/issue_show/components/fields/description.vue
View file @
29278027
...
@@ -20,6 +20,9 @@
...
@@ -20,6 +20,9 @@
components
:
{
components
:
{
markdownField
,
markdownField
,
},
},
mounted
()
{
this
.
$refs
.
textarea
.
focus
();
},
};
};
</
script
>
</
script
>
...
@@ -39,7 +42,7 @@
...
@@ -39,7 +42,7 @@
data-supports-slash-commands=
"false"
data-supports-slash-commands=
"false"
aria-label=
"Description"
aria-label=
"Description"
v-model=
"formState.description"
v-model=
"formState.description"
ref=
"texta
t
ea"
ref=
"texta
r
ea"
slot=
"textarea"
>
slot=
"textarea"
>
</textarea>
</textarea>
</markdown-field>
</markdown-field>
...
...
spec/javascripts/issue_show/components/fields/description_spec.js
0 → 100644
View file @
29278027
import
Vue
from
'
vue
'
;
import
descriptionField
from
'
~/issue_show/components/fields/description.vue
'
;
describe
(
'
Description field component
'
,
()
=>
{
let
vm
;
beforeEach
((
done
)
=>
{
const
Component
=
Vue
.
extend
(
descriptionField
);
// Needs an el in the DOM to be able to text the element is focused
const
el
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
el
);
vm
=
new
Component
({
el
,
propsData
:
{
formState
:
{
description
:
''
,
},
markdownDocs
:
'
/
'
,
markdownPreviewUrl
:
'
/
'
,
},
}).
$mount
();
Vue
.
nextTick
(
done
);
});
it
(
'
focuses field when mounted
'
,
()
=>
{
expect
(
document
.
activeElement
,
).
toBe
(
vm
.
$refs
.
textarea
);
});
});
Write
Preview
Markdown
is supported
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