Need to set all: unset; first to avoid messing with display: none;.

This commit is contained in:
Stefan Sundin 2023-12-22 15:19:11 -08:00
parent 62a9bb59e1
commit 616ef7f062
6 changed files with 7 additions and 7 deletions

View file

@ -87,8 +87,8 @@ class Autocomplete {
const styleSheet = createStylesheet('css/autocomplete.css');
const colorStyleSheet = createStylesheet('css/colors.css');
this.wrapper = kpxcUI.createElement('div');
this.wrapper.style.display = 'none';
this.wrapper.style.all = 'unset';
this.wrapper.style.display = 'none';
styleSheet.addEventListener('load', () => this.wrapper.style.display = 'block');
this.container = kpxcUI.createElement('div', 'kpxcAutocomplete-container', { 'id': 'kpxcAutocomplete-container' });

View file

@ -122,8 +122,8 @@ kpxcBanner.create = async function(credentials = {}) {
const colorStyleSheet = createStylesheet('css/colors.css');
const wrapper = document.createElement('div');
wrapper.style.display = 'none';
wrapper.style.all = 'unset';
wrapper.style.display = 'none';
styleSheet.addEventListener('load', () => wrapper.style.display = 'block');
this.shadowRoot = wrapper.attachShadow({ mode: 'closed' });
this.shadowRoot.append(colorStyleSheet);

View file

@ -128,14 +128,14 @@ kpxcCustomLoginFieldsBanner.create = async function() {
const colorStyleSheet = createStylesheet('css/colors.css');
const wrapper = document.createElement('div');
wrapper.style.display = 'none';
wrapper.style.all = 'unset';
wrapper.style.display = 'none';
styleSheet.addEventListener('load', () => wrapper.style.display = 'block');
this.shadowRoot = wrapper.attachShadow({ mode: 'closed' });
this.shadowRoot.append(colorStyleSheet);
this.shadowRoot.append(styleSheet);
this.shadowRoot.append(defineStyleSheet);
this.shadowRoot.append(buttonStyleSheet);
this.shadowRoot.append(styleSheet);
// Only create the banner to top window
if (window.self === window.top) {

View file

@ -160,8 +160,8 @@ TOTPFieldIcon.prototype.createIcon = function(field, segmented = false) {
const styleSheet = createStylesheet('css/totp.css');
const wrapper = document.createElement('div');
wrapper.style.display = 'none';
wrapper.style.all = 'unset';
wrapper.style.display = 'none';
styleSheet.addEventListener('load', () => wrapper.style.display = 'block');
this.shadowRoot = wrapper.attachShadow({ mode: 'closed' });

View file

@ -292,8 +292,8 @@ kpxcUI.createNotification = function(type, message) {
const styleSheet = createStylesheet('css/notification.css');
notificationWrapper = notificationWrapper || document.createElement('div');
notificationWrapper.style.display = 'none';
notificationWrapper.style.all = 'unset';
notificationWrapper.style.display = 'none';
styleSheet.addEventListener('load', () => notificationWrapper.style.display = 'block');
this.shadowRoot = notificationWrapper.attachShadow({ mode: 'closed' });
if (!this.shadowRoot) {

View file

@ -109,8 +109,8 @@ UsernameFieldIcon.prototype.createIcon = function(field) {
const styleSheet = createStylesheet('css/username.css');
const wrapper = document.createElement('div');
wrapper.style.display = 'none';
wrapper.style.all = 'unset';
wrapper.style.display = 'none';
styleSheet.addEventListener('load', () => wrapper.style.display = 'block');
this.shadowRoot = wrapper.attachShadow({ mode: 'closed' });