Comments (6)
Okay. I've gone ahead with a change to report { canceled: "toggle" }
in this case.
from elix.
This also happens with the .detail
property of the "close"
event. I tried out the whenClosed
variant before checking the close event, because the documentation doesn't really tell you that this .detail
property exists.
from elix.
Sorry for the slow response, will take a look as soon as I can.
from elix.
Thanks for your patience. I had time to dig into this today.
There appear to be two parts to this issue.
First problem: the relevant mixin, OpenCloseMixin, was resetting the closeResult to undefined whenever a component's open
method was called. The idea is that, once a component is opened, its closeResult is not defined until the component is closed.
That's correct but insufficient. In this case, the FilterComboBox toggle button is calling the toggle
method, which skirted the resetting of closeResult to undefined.
I've just checked in a fix for this first problem on #main. The fix resets closeResult to undefined whenever a component's opened state changes to true — regardless of how the component was opened. In particular, the closeResult will now be reset when the toggle
method opens a combo box.
Second problem: what's an appropriate closeResult when the user closes the component by clicking the toggle?
If the user picked an item, the combo box returns that item via the closeResult. But there are a variety of other possible closeResult values for various UI actions that can close a popup, including: canceling with the Escape key, canceling with the F4 key (a standard popup close key on Windows), and canceling on window blur.
To the extent that closeResult communicates why a popup was closed, it feels like the same goal should apply to closing a popup by clicking the toggle again. For example, we could define a new close result: { canceled: "toggle" }
.
(In retrospect, I wish that the closeResult for an item being selected had been something like { selected: <item> }
, to indicate both why the combo box was closed and what was selected. But that would be a breaking change now, and I'd prefer to avoid that.)
Before defining a new closeResult for the toggle case, I wanted to see if you had thoughts about it.
from elix.
Glad to hear that the problem is now fixed!
I don't really have a strong opinion as to what the result is, as long as I can work with it.
from elix.
This has now been released as Elix 15.0.1.
from elix.
Related Issues (20)
- Events(Tap,mousedown) Not triggered after moving from 7 to 12. HOT 4
- Inclusion of Elix Components in my designer demo HOT 3
- Issue summary, including the name of the relevant component or mixin HOT 1
- unhandled promises in the code HOT 3
- Location is not defined HOT 2
- How can I combine components and mixins? HOT 2
- Request: Improve documentation HOT 1
- How manually update input value get from NumberSpinBox ? HOT 3
- FormElementMixin issue with Firefox 93 HOT 3
- Filtered ListComboBox loses attachement to text input HOT 5
- Input component does not allow "type" attribute HOT 2
- Carousel content can overflow (min-width: auto for flex) HOT 2
- Carousel / SlidingStageContent does not support fixed-positioned content such as DropdownList / Popup HOT 1
- Typescript "noImplicitAny" fails on method attributeChangedCallback in shared.d.ts
- Carousel not compiling to library HOT 4
- scss file is not supported, how we can provide support with scss HOT 2
- Wrong link in GitHub's "About" section HOT 1
- MenuItem and DropdownList, checkmark icon should be optional HOT 2
- Typescript types missing? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elix.