Skip to content

Commit 4196fb7

Browse files
authored
Visual Label not provided for "Title" and "Description" field: A11y_Visual Studio Code Web Extensions_Github Pull request_Create New Request_Labels or Instructions (#7882)
* Visual Label not provided for "Title" and "Description" field: A11y_Visual Studio Code Web Extensions_Github Pull request_Create New Request_Labels or Instructions Fixes #7595 * Address feedback
1 parent 227200b commit 4196fb7

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

webviews/createPullRequestViewNew/app.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export function main() {
220220
</div>
221221
</div>
222222

223+
<label htmlFor='title' className='input-title'>Title</label>
223224
<div className='group-title'>
224225
<input
225226
id='title'
@@ -231,7 +232,6 @@ export function main() {
231232
aria-invalid={!!params.showTitleValidationError}
232233
aria-describedby={params.showTitleValidationError ? 'title-error' : ''}
233234
placeholder='Title'
234-
aria-label='Title'
235235
title='Required'
236236
required
237237
onChange={(e) => updateTitle(e.currentTarget.value)}
@@ -325,12 +325,12 @@ export function main() {
325325
: null}
326326
</div>
327327

328+
<label htmlFor='description' className='input-title'>Description</label>
328329
<div className='group-description'>
329330
<textarea
330331
id='description'
331332
name='description'
332333
placeholder='Description'
333-
aria-label='Description'
334334
value={params.pendingDescription}
335335
onChange={(e) => ctx.updateState({ pendingDescription: e.currentTarget.value })}
336336
onKeyDown={(e) => onKeyDown(false, e)}
@@ -371,13 +371,15 @@ export function main() {
371371
);
372372
}
373373

374-
export function Root({ children }) {
374+
interface RootProps { children: (params: CreateParamsNew) => JSX.Element }
375+
376+
export function Root({ children }: RootProps): JSX.Element {
375377
const ctx = useContext(PullRequestContextNew);
376378
const [pr, setPR] = useState<any>(ctx.createParams);
377379
useEffect(() => {
378380
ctx.onchange = setPR;
379381
setPR(ctx.createParams);
380382
}, []);
381383
ctx.postMessage({ command: 'ready' });
382-
return children(pr);
384+
return <>{children(pr)}</>;
383385
}

webviews/createPullRequestViewNew/index.css

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ textarea:disabled {
3131

3232
.group-branches {
3333
margin-top: 20px;
34-
margin-bottom: 10px;
34+
margin-bottom: 2px;
3535
}
3636

3737
.input-label.base,
@@ -72,8 +72,8 @@ button.input-box {
7272
.input-label {
7373
display: flex;
7474
align-items: center;
75-
font-variant-caps: all-small-caps;
76-
font-size: small;
75+
font-size: 11px;
76+
text-transform: uppercase;
7777
margin-bottom: 14px;
7878
}
7979

@@ -86,6 +86,13 @@ button.input-box {
8686

8787
/* Title, Description */
8888

89+
.input-title {
90+
display: block;
91+
font-size: 11px;
92+
margin-bottom: 4px;
93+
text-transform: uppercase;
94+
}
95+
8996
#title {
9097
padding-right: 24px;
9198
text-overflow: ellipsis;
@@ -95,6 +102,7 @@ button.input-box {
95102
position: relative;
96103
display: flex;
97104
flex-direction: column;
105+
margin-bottom: 12px;
98106
}
99107

100108
.group-title .title-action:hover {
@@ -141,7 +149,6 @@ button.input-box {
141149

142150
.group-description {
143151
flex-grow: 1;
144-
margin-top: 10px;
145152
max-height: 500px;
146153
}
147154

0 commit comments

Comments
 (0)