-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Label Component #15
Comments
@andersevenrud Hello, I would like to contribute to fix this issue. Let me try to get a better idea of what you are looking for. What I gathered from the description - you are thinking a text tag that will be tied to a field? |
Nice! I was thinking this (illustrating with JSX):
Which would produce something like:
Then just have a data- attribute or a classname defined the position of the label. For assistive technologies both the label and inputs would require |
Currently all applications have their own There are some plans of (fixing) changing this: #11 |
Any luck ? Let me know if you need help 😊 |
@andersevenrud I tried linking inside the application ( Here's (something like) the sequence of commands I am trying to get changes to show up. I'm not at my PC right now, but basically I'm just building and linking (in order) 1. osjs-gui 2. the whole project, then 3. the paint application.
|
This is usually what I do:
Then after that just run The linking inside the OS.js installation directory just ensures that the service provider and stylesheet is loaded. The apps are what imports the GUI components. |
Oh, and anything in |
Heh, maybe what was missing here is The |
@andersevenrud Ok, I ran the same commands but cannot make any changes in the actual app. I'd really like to contribute, but I don't want to waste your time. I'll work on getting the module to build and link correctly, but you shouldn't depend on me for this Issue request. And honestly, I'm new to server-side JS stuff so the Hyperapp view system here is a little too clever for me at the place I'm at. I will keep trying though, and maybe I can be helpful on future requests. |
No waste, man. I'd want this to work for you, heh. As long as you watch/build your application in addition to osjs-gui this should work just fine. I'll see if I can't throw together something to demo this :)
All of this is client-side, actually. |
@andersevenrud Oi. Wouldn't you know it, I jinxed myself. The reason my changes weren't happening was because the properties passed into createField are being filtered. That's why my changes weren't showing up -- I tried a change to Box and it worked. I had made some other changes to test if I was building correctly, but at that point I was using So, I will get working on this one! Thanks a lot for your patience. I got pretty frustrated, but I'm glad you didn't. |
Aha! Well, no wonder then 😅 Looking forward to see what you come up with :) |
@andersevenrud It works! Do you have any styling kind of preferences for the labels such as margins or font size? So you can review my work before PR: currently, I have diverged from the illustration you recommended. Here is the structure of the component:
I did it this way for two reasons: 1. it fits vanilla HTML forms norms and 2. It will allow for better accessibility (I think) when we add the
|
@bstee615 Looking great! 😃
The standard margin/padding for pretty much everything is 1/2 |
@andersevenrud Okay. And lastly, how should I write unit tests? I see that you have the project set up for Jest, but do not see any in the project and |
Glad that you mention it. There's a lack of unit tests across pretty much all packages (embarrassingly). Though, I'm working on it 🤓 I'm going to commit everything that I've done in 😅 |
I actually pushed what I have so far here https://github.com/os-js/osjs-client/tree/unit-tests/ . So if you want to take a stab at it in this package, basically follow that pattern :) |
Completely messed up that branch.... but it should be fixed and up-to-date now. |
@andersevenrud Okay, then I will forgo the unit tests for now and submit a PR. |
I just published a new release that contains #17 😄 |
Need a "Label" component that could be used in combination with fields with a left/top/bottom arrangement.
The text was updated successfully, but these errors were encountered: