-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add focus
attribute support
#170
Comments
Adding focus and blur to prototype helps align the custom element closer to the native behavior, would be nice if you could create a PR for it @manuel-guilbault |
Also I think all inputable custom elements need to expose methods blur and focus sooner / later, so it's will be a conflict if focus is made bindable property. @ZHollingshead @EisenbergEffect thoughts ? |
I agree that focus/blur APIs on relevant components is an important part of what we need to do. |
Other than |
I've also noticed the following issue with |
Unfortunately I'm yet unable to build properly the library so I don't feel like doing any PR yet with my work. So here is a call for help. If I can start building properly the library on my machine I would be more than happy to continue contributing. In order to test locally I managed to build the textarea component on its own, but not the whole aurelia/ux library using lerna. (see my issue here: https://discourse.aurelia.io/t/contributing-to-aurelia-ux/3023). Once the single component is built, I copy/paste the I'm working on Mac OS X (Mojave), with Node 10.14.2, NPM 6.6.0, Typescript 3.6.4. I say it again, I would really appreciate help so that I can properly build the library (with lerna) and start making PRs. Many thanks! |
@ben-girardet thanks for this, I'll setup something so folks can easily verify their changes/local setup & contribute |
|
For now, it should be a simpel local app that alias Ux dependencies to local packages, so you get faster feedback cycle via simple |
No promises but I'll try. |
@khuongduybui glad to hear that :) And i've finished the setup locally. Now you can simply do: npm ci
cd app # local app development
npm ci
npm run dev -> start editing ux packages and get live reload Will push up the code later tonight |
@ben-girardet an small update: https://github.com/bigopon/aurelia-ux/blob/dev-test-app/app/src/app.html |
Wouaw thank you so much @bigopon for the great support on this issue and aurelia/dependency-injection#187 Using you dev-test-app branch I can now
Now, what do you recommend for me to do? Should I wait for a PR in main repo, or would it be better to fork your fork ? My concern is that if I fork your repo, I'm not quite sure how to properly do PRs. |
@ben-girardet glad to hear you were able to verify it. I also prepared an easy way to build directly into a folder in different path, making it friendlier for testing with existing apps. cd packages/textarea
npm run build:dev:watch -- --environment target_dir: relative/path/to/my/app Besides that, before we proceed with adding focus behavior on the ux inputable element, we need to define how they will behave, aka some specs. Would be nice if you could have some short notes for it to discuss easier. And finally, would be nice if you (and others) could help contributing further to UX, we are quite short in contribution here 😙 |
I think we should wait a little bit for @bigopon changes to get merged back into main repo. At least that's what I'll be doing. |
@ben-girardet @khuongduybui I've completed refacotring all the component builds, and updated my branch. https://github.com/bigopon/aurelia-ux/blob/dev-test-app/app/src/app.html A few final touches and it should be ready to go |
Can't wait to work with this new tooling. It definitely motivates me to contribute. I'm very new to the open source world and therefore might need some guiding along the way. As I'm using Aurelia UX in various projects since nearly the beginning I really would like to help the project move forward. At the moment I'm planning to contribute towards:
Hopefully by helping out with Back to the focus attribute discussion: from my understanding of this thread:
|
@ben-girardet it's ready at #216 About the list of focus/blur behavior, it sounds like a good start, we can iterate based on that more, just need to have it somewhere, so if you are going to create a PR for that, lets put the list in a |
@bigopon thank you ! When you say it's ready, I still need to wait for it to be merged before I can fork and start making a PR for the focus attribute. Right ? |
Started to tackle the focus attribute issue here: https://github.com/platform5/ux/tree/focus-attribute When writing the design decision I went to the conclusion that components that don't actually have a keyboard input feature don't need the Regarding
Related commit for |
A general direction we should align ourselves to is standard.it couls be difficult to implement because we have to keep track od many things. About the component with typing you mentioned, we may need to do it ina different component instead, called combobox maybe? |
What is standard.it ? Good idea to separate ux-select component with another one with such capabilities. Therefore I’m thinking that we can keep ux-select as is without implementing the |
Standard. It |
I'm submitting a feature request
0.10.0
Current behavior:
Trying to use the built-in
focus
attribute on UX components (e.g.:ux-input
orux-textarea
) doesn't work.Expected/desired behavior:
Since
focus
is a built-in attribute, one would expect it to work with UX focusable components.Analysis
I see two ways to implement this.
A first solution would be to expose a two-way bindable
focus
property, which would in turn be bound on the underlying input/select/textarea (this is already what's done forux-textarea
):However, after a couple of tests with
ux-textarea
, it doesn't seem to work. It looks like Aurelia gives precedence to custom attributes over a custom element's bindable properties when there's a name conflict. This means that whenaurelia-templating-resources
is loaded, any property namedfocus
on a custom element will be ignored and thefocus
custom attribute will be used instead. So, implementing this solution would require to change how Aurelia resolves attributes naming conflicts.A second solution would be to add the
focus
andblur
methods to the component's HTML element (through the custom prototype), so the built-infocus
attribute can work properly (it works by calling those methods when the value bound to it changes):The text was updated successfully, but these errors were encountered: