Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Contrib > Lookup Component (Part 1) > Dropdown A11y Adjustments #1386

Merged
merged 41 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
751c39d
Finished implementation
Blackbaud-SteveBrush Dec 19, 2017
2923601
Added unit tests
Blackbaud-SteveBrush Dec 20, 2017
c28a556
Added unit tests
Blackbaud-SteveBrush Dec 20, 2017
33c19d0
Updated docs
Blackbaud-SteveBrush Dec 20, 2017
9da7ed4
Adjusted docs slightly
Blackbaud-SteveBrush Dec 20, 2017
d918749
Removed uneccessary changes
Blackbaud-SteveBrush Dec 20, 2017
3876f80
Added condition for active item not found
Blackbaud-SteveBrush Dec 20, 2017
e686cc7
Modified message type
Blackbaud-SteveBrush Jan 4, 2018
4605666
Renamed menu change event
Blackbaud-SteveBrush Jan 5, 2018
2de86a5
Updated message type
Blackbaud-SteveBrush Jan 5, 2018
913bdfc
Merged conflicts
Blackbaud-SteveBrush Jan 8, 2018
88e4e42
Minor code style adjustments
Blackbaud-SteveBrush Jan 9, 2018
78141c4
Updated unsubscribe process
Blackbaud-SteveBrush Jan 10, 2018
7106c61
Made destroy stream private
Blackbaud-SteveBrush Jan 10, 2018
08a9f5f
Merge branch 'master' into dropdown-a11y
Blackbaud-SteveBrush Jan 10, 2018
4e1c56d
Dropdown now uses popover
Blackbaud-SteveBrush Jan 12, 2018
d0f951c
Merged conflicts
Blackbaud-SteveBrush Jan 12, 2018
aed0109
Added unit tests
Blackbaud-SteveBrush Jan 13, 2018
2771ba6
Updated a11y interactions
Blackbaud-SteveBrush Jan 17, 2018
4261931
Updated popover styles to accommodate other modules
Blackbaud-SteveBrush Jan 19, 2018
0c1f0ec
Updated docs home page
Blackbaud-SteveBrush Jan 19, 2018
75f8c0a
Fixed unit tests
Blackbaud-SteveBrush Jan 21, 2018
06ba84f
Updated unit tests for popover and dropdown
Blackbaud-SteveBrush Jan 22, 2018
a78652c
Updated unit tests
Blackbaud-SteveBrush Jan 23, 2018
f485eca
100 percent code coverage
Blackbaud-SteveBrush Jan 23, 2018
0d844de
Adjusted unit tests
Blackbaud-SteveBrush Jan 23, 2018
e14f804
Fixed dropdown alignment issue
Blackbaud-SteveBrush Jan 23, 2018
aaea6fe
Removed some comments
Blackbaud-SteveBrush Jan 23, 2018
ddcfefb
Adjusted testutility to support IE11
Blackbaud-SteveBrush Jan 23, 2018
ec25dd1
Fixed issue with tab dropdown
Blackbaud-SteveBrush Jan 23, 2018
9550897
Updated visual tests
Blackbaud-SteveBrush Jan 23, 2018
4183623
Merge branch 'master' into dropdown-a11y
Blackbaud-SteveBrush Jan 23, 2018
d40ad17
Renamed public top and left properties for Popup
Blackbaud-SteveBrush Jan 24, 2018
8b9ba3e
Adjusted how escape key is handled
Blackbaud-SteveBrush Jan 24, 2018
3c9b75f
Added focus on escape
Blackbaud-SteveBrush Jan 24, 2018
a1be4c4
Updated how focus is detected
Blackbaud-SteveBrush Jan 24, 2018
ecc2732
Updated demo; dropdown now using stream internally
Blackbaud-SteveBrush Jan 24, 2018
0f1f39e
Removed hover example from dropdown demo
Blackbaud-SteveBrush Jan 24, 2018
a15deae
Updated fullscreen appearance
Blackbaud-SteveBrush Jan 25, 2018
7d91612
Fixed fullscreen issue
Blackbaud-SteveBrush Jan 26, 2018
ace2ccc
Fixed popover reposition being called prematurely
Blackbaud-SteveBrush Jan 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@
{
// Columns at which to show vertical rulers
"editor.rulers": [100],

// Controls after how many characters the editor will wrap to the next line. Setting this to 0 turns on viewport width wrapping (word wrapping). Setting this to -1 forces the editor to never wrap.
"editor.wordWrap": "wordWrapColumn",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing some outdated settings, as well as the word wrap requirement.

"editor.wordWrapColumn": 100,

"typescript.tsdk": "node_modules/typescript/lib",
"vsicons.presets.angular": true
"typescript.tsdk": "node_modules/typescript/lib"
}
6 changes: 2 additions & 4 deletions config/karma/local.karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ module.exports = function (config) {
require('./shared.karma.conf')(config);

config.set({
browsers: [
'Chrome'
]
browsers: ['Chrome'],
logLevel: config.LOG_DEBUG
});

};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
146 changes: 146 additions & 0 deletions skyux-spa-visual-tests/src/app/popover/popover-visual.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>

<button
id="btn-popover-placement-above-left" class="sky-btn" [skyPopover]="myPopover2a" skyPopoverPlacement="above" skyPopoverAlignment="left">
Top, align left
</button>

<sky-popover #myPopover2a>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>

<button
id="btn-popover-placement-above-right" class="sky-btn" [skyPopover]="myPopover2b" skyPopoverPlacement="above" skyPopoverAlignment="right">
Top, align right
</button>

<sky-popover #myPopover2b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>

<button id="btn-popover-placement-below" class="sky-btn" [skyPopover]="myPopover3" skyPopoverPlacement="below">
Below
</button>
Expand All @@ -79,6 +97,24 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>

<button
id="btn-popover-placement-below-left" class="sky-btn" [skyPopover]="myPopover3a" skyPopoverPlacement="below" skyPopoverAlignment="left">
Below, align left
</button>

<sky-popover #myPopover3a>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>

<button
id="btn-popover-placement-below-right" class="sky-btn" [skyPopover]="myPopover3b" skyPopoverPlacement="below" skyPopoverAlignment="right">
Below, align right
</button>

<sky-popover #myPopover3b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>

<button id="btn-popover-placement-left" class="sky-btn" [skyPopover]="myPopover4" skyPopoverPlacement="left">
Left
</button>
Expand All @@ -88,6 +124,16 @@
</sky-popover>
</div>

<div id="screenshot-popover-tiny">
<button id="btn-popover-tiny" class="sky-btn" [skyPopover]="myPopoverTiny">
Default
</button>

<sky-popover #myPopoverTiny>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit arcu.
</sky-popover>
</div>

<div id="screenshot-popover-with-dropdown">
<button id="btn-popover-with-dropdown" class="sky-btn" [skyPopover]="myPopoverWithDropdown">
Default
Expand Down Expand Up @@ -119,3 +165,103 @@
</sky-dropdown>
</sky-popover>
</div>

<div id="screenshot-popover-positioned-parent" style="padding:40px;">
<div style="border:1px solid red;position:relative;padding:30px;background-color:#f1f1f1;">
<button
id="btn-popover-position-parent-left"
class="sky-btn"
type="button"
[skyPopover]="positionedParent1"
skyPopoverPlacement="below"
skyPopoverAlignment="left">
Below, align left
</button>

<sky-popover #positionedParent1>
The content of a popover can be text, HTML, or Angular components.
</sky-popover>

<button
id="btn-popover-position-parent-right"
class="sky-btn"
type="button"
style="float:right;"
[skyPopover]="positionedParent2"
skyPopoverPlacement="below"
skyPopoverAlignment="left">
Below, align left
</button>

<sky-popover #positionedParent2>
The content of a popover can be text, HTML, or Angular components.
</sky-popover>
</div>
</div>

<div id="screenshot-popover-wide-buttons">
<p>
<button
class="sky-btn"
type="button"
style="display:block;width:100%;"
[skyPopover]="myPopover5"
skyPopoverPlacement="below">
Open popover
</button>
</p>
<p>
<button
class="sky-btn"
type="button"
style="display:block;width:100%;"
[skyPopover]="myPopover5"
skyPopoverPlacement="below"
skyPopoverAlignment="left">
Open popover
</button>
</p>
<p>
<button
class="sky-btn"
type="button"
style="display:block;width:100%;"
[skyPopover]="myPopover5"
skyPopoverPlacement="below"
skyPopoverAlignment="right">
Open popover
</button>
</p>
<p>
<button
class="sky-btn"
type="button"
style="display:block;width:100%;"
[skyPopover]="myPopover5"
skyPopoverPlacement="above">
Open popover
</button>
</p>
<p>
<button
class="sky-btn"
type="button"
style="display:block;width:100%;"
[skyPopover]="myPopover5"
skyPopoverPlacement="above"
skyPopoverAlignment="left">
Open popover
</button>
</p>
<p>
<button
class="sky-btn"
type="button"
style="display:block;width:100%;"
[skyPopover]="myPopover5"
skyPopoverPlacement="above"
skyPopoverAlignment="right">
Open popover
</button>
</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@

.popover-visual-container {
padding: 10px;
}

/deep/
.sky-popover-container {
position: static !important;
opacity: 1 !important;
visibility: visible !important;
::ng-deep .sky-popover-container {
position: relative !important;
width: 100% !important;
opacity: 1 !important;
visibility: visible !important;
z-index: 1;

.sky-popover {
margin: 0;
}
}
}
}

#screenshot-popover-placements,
#screenshot-popover-tiny,
#screenshot-popover-with-dropdown {
padding: 200px 350px;
}
64 changes: 62 additions & 2 deletions skyux-spa-visual-tests/src/app/popover/popover.visual-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@ describe('Popover', () => {
.then(() => testPopoverPlacement('above'));
});

it('should open a popover above-left the caller', () => {
return SkyVisualTest
.setupTest('popover')
.then(() => testPopoverPlacement('above-left'));
});

it('should open a popover above-right the caller', () => {
return SkyVisualTest
.setupTest('popover')
.then(() => testPopoverPlacement('above-right'));
});

it('should open a popover below-left the caller', () => {
return SkyVisualTest
.setupTest('popover')
.then(() => testPopoverPlacement('below-left'));
});

it('should open a popover below-right the caller', () => {
return SkyVisualTest
.setupTest('popover')
.then(() => testPopoverPlacement('below-right'));
});

it('should open a popover below the caller', () => {
return SkyVisualTest
.setupTest('popover')
Expand All @@ -54,8 +78,16 @@ describe('Popover', () => {

it('should handle tiny screens', () => {
return SkyVisualTest
.setupTest('popover', 767)
.then(() => testPopoverPlacement('above'));
.setupTest('popover', 768)
.then(() => {
SkyVisualTest.scrollElementIntoView(`#screenshot-popover-tiny`);
element(by.id(`btn-popover-tiny`)).click();
return SkyVisualTest
.compareScreenshot({
screenshotName: `popover-placement-tiny`,
selector: '#screenshot-popover-tiny'
});
});
});

it('should handle absolutely positioned items inside the popover', () => {
Expand All @@ -72,4 +104,32 @@ describe('Popover', () => {
});
});
});

it('should handle left aligned popover in positioned parent', () => {
return SkyVisualTest
.setupTest('popover')
.then(() => {
SkyVisualTest.scrollElementIntoView('#screenshot-popover-positioned-parent');
element(by.id('btn-popover-position-parent-left')).click();
return SkyVisualTest
.compareScreenshot({
screenshotName: 'popover-position-parent-left',
selector: '#screenshot-popover-positioned-parent'
});
});
});

it('should handle right aligned popover in positioned parent', () => {
return SkyVisualTest
.setupTest('popover')
.then(() => {
SkyVisualTest.scrollElementIntoView('#screenshot-popover-positioned-parent');
element(by.id('btn-popover-position-parent-right')).click();
return SkyVisualTest
.compareScreenshot({
screenshotName: 'popover-position-parent-right',
selector: '#screenshot-popover-positioned-parent'
});
});
});
});
4 changes: 3 additions & 1 deletion src/demos/colorpicker/colorpicker-demo.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div style="margin-bottom: 10px">
<sky-colorpicker #colorPickerExample1>
<sky-colorpicker
(selectedColorChanged)="onSelectedColorChanged($event)"
#colorPickerExample1>
<input
[skyColorpickerInput]="colorPickerExample1"
[(ngModel)]="color1" [presetColors]="presetColors1"
Expand Down
6 changes: 5 additions & 1 deletion src/demos/colorpicker/colorpicker-demo.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Component } from '@angular/core';

import { SkyColorpickerOutput } from '../../core';

@Component({
selector: 'sky-colorpicker-demo',
templateUrl: './colorpicker-demo.component.html'
Expand All @@ -24,5 +26,7 @@ export class SkyColorpickerDemoComponent {
'#68AFEF'
];

public constructor() { }
public onSelectedColorChanged(args: SkyColorpickerOutput) {
console.log('You selected this color:', args);
}
}
Loading