chore(rich-select): revert delegate of disabled on readonly for invoker
This commit is contained in:
parent
8c5ea8c1c4
commit
abf82f61e6
3 changed files with 1 additions and 19 deletions
|
|
@ -42,13 +42,6 @@ export class LionSelectInvoker extends LionButton {
|
|||
this.type = 'button';
|
||||
}
|
||||
|
||||
_requestUpdate(name, oldValue) {
|
||||
super._requestUpdate(name, oldValue);
|
||||
if (name === 'readOnly') {
|
||||
this.disabled = this.readOnly;
|
||||
}
|
||||
}
|
||||
|
||||
_contentTemplate() {
|
||||
if (this.selectedElement) {
|
||||
const labelNodes = Array.from(this.selectedElement.querySelectorAll('*'));
|
||||
|
|
|
|||
|
|
@ -48,13 +48,6 @@ describe('lion-select-invoker', () => {
|
|||
expect(el.getAttribute('tabindex')).to.equal('0');
|
||||
});
|
||||
|
||||
it('delegates the readonly attribute to disabled', async () => {
|
||||
const el = await fixture(html`
|
||||
<lion-select-invoker readonly></lion-select-invoker>
|
||||
`);
|
||||
expect(el.hasAttribute('disabled')).to.be.true;
|
||||
});
|
||||
|
||||
describe('Subclassers', () => {
|
||||
it('supports a custom _contentTemplate', async () => {
|
||||
const myTag = defineCE(
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ describe('lion-select-rich', () => {
|
|||
expect(el._invokerNode.selectedElement).to.equal(el.querySelectorAll('lion-option')[1]);
|
||||
});
|
||||
|
||||
it('delegates readonly to the invoker, where disabled is added on top of this to disable opening', async () => {
|
||||
it('delegates readonly to the invoker', async () => {
|
||||
const el = await fixture(html`
|
||||
<lion-select-rich readonly>
|
||||
<lion-options slot="input">
|
||||
|
|
@ -81,11 +81,7 @@ describe('lion-select-rich', () => {
|
|||
`);
|
||||
|
||||
expect(el.hasAttribute('readonly')).to.be.true;
|
||||
// rich select is not disabled, so value is still serialized in forms when readonly
|
||||
expect(el.hasAttribute('disabled')).to.be.false;
|
||||
expect(el._invokerNode.hasAttribute('readonly')).to.be.true;
|
||||
// invoker node has disabled, to disable it from being clicked
|
||||
expect(el._invokerNode.hasAttribute('disabled')).to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue