Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlling the rendering of a disabled navigation control #165

Merged
Merged
Changes from all commits
Commits
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
31 changes: 24 additions & 7 deletions src/pb-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ export class PbNavigation extends pbHotkeys(pbMixin(LitElement)) {
*/
keyboard: {
type: String
},
/**
* Rendition of the navigation element if it's disabled
* Possible values:
* - hidden (default if not set; control is removed from the document layout)
* - invisible (controll is hidden, but keeped in the document layout)
* - visible (control is visible)
*/
rendition : {
type: String
}
};
}
Expand Down Expand Up @@ -79,13 +89,20 @@ export class PbNavigation extends pbHotkeys(pbMixin(LitElement)) {

static get styles() {
return css`
:host {
display: inline;
}
:host([disabled]) {
display: none;
}
`;
:host {
display: inline;
}
:host([disabled]):host(:not([rendition])), :host([disabled]):host([rendition="hidden"]) {
display: none;
}
:host([disabled]):host([rendition="invisible"]) {
visibility: hidden;
}
:host([disabled]):host([rendition="visible"]) {
visibility: visible;
cursor: not-allowed;
}
`;
}
}

Expand Down
Loading