Comments (8)
Yes, it's not that simple. In VeeValidate, they do something similar with the Form, Field, ErrorMessage Components. It's a bit too magical for me.
The developer has written an article on the subject: https://logaretm.com/blog/making-the-most-out-of-vuejs-injections/
from oruga.
I tested with the new version 0.8.8 and it works. Thanks
from oruga.
The use of 'aria-labelledby' breaks also the use of getByLabel('Firstname')
In v0.7, it's working
<div class="field" placeholder="First Name" type="text">
<label
for="firstname"
class="label"
><div class="is-inline-flex is-align-items-center">
First Name <span class="is-required">*</span>
</div>
</label
>
<div class="control">
<input
placeholder="First Name"
name="firstname"
id="firstname"
class="input"
type="text"
autocomplete="off"
/>
</div>
</div>
In 0.8, its not working
<div class="field" placeholder="First Name" type="text">
<label
for="firstname"
class="label"
><div class="is-inline-flex is-align-items-center">
First Name <span class="is-required">*</span>
</div>
</label
>
<div class="control">
<input
placeholder="First Name"
name="firstname"
id="firstname"
class="input"
type="text"
autocomplete="off"
aria-labelledby="5usgluoiyzy"
/>
</div>
</div>
from oruga.
Yeah the uuid()
default of ariaLabelledby
needs to be removed. I like the idea of injecting the id
used for o-field into the o-input component. But with the posibility to override it with a directly passed prop to o-input.
from oruga.
Like this ?
without labelFor
attribute in o-field
<o-field label="Name">
<o-input model-value="Kevin Garvey" />
</o-field>
Generates:
<div data-oruga="field" class="field">
<label
class="label"
+ for="9kht9axc5v4"
>Name</label>
<div data-oruga="input" class="control">
<input
data-oruga-input="text"
type="text"
class="input"
autocomplete="off"
+ id="9kht9axc5v4"
/>
</div>
</div>
With labelFor
attribute in o-field
<o-field label="Name" label-for="name">
<o-input model-value="Kevin Garvey" id="name" />
</o-field>
Generates
<div data-oruga="field" class="field">
<label class="label"
+ for="name"
>Name</label>
<div data-oruga="input" class="control">
<input
data-oruga-input="text"
type="text"
class="input"
autocomplete="off"
+ id="name"
/>
</div>
</div>
from oruga.
@Messenger yes, something like that. I just need to figure out whether the o-field should define the id and pass it down, or the input below should define the id and pass it up to the o-field...
from oruga.
However, I see the strength of Oruga more in the features of the other components. For proper form components with validation and so on I suggest FormKit.
from oruga.
@messenjer Wow, thank you so much for the article, it is very interesting!
from oruga.
Related Issues (20)
- [Component]: Breadcrumb HOT 1
- Unable to disable animation on `Tabs` component
- Can't reset the sorting of the table component HOT 1
- Autocomplete: make vmodel be the selected option HOT 1
- Table Column Visibility Not Updating When Visible Is Changed HOT 8
- Datepicker component no longer editable HOT 4
- Error undefined value when clicking menu item
- Taginput with autocomplete does not work if data is an array of objects HOT 2
- Taginput: cannot remove custom items, no removeItem() function HOT 6
- Add way to skip all or part of components registration HOT 2
- Datepicker: custom classes props are ignored HOT 4
- Text input broken for horizontal fields HOT 4
- Infinite recursive update freezing the browser when updating asynchronously a TagInput model value HOT 3
- HTML5 required validity does not work with OSelect component with a placeholder HOT 3
- datetimepicker: Editing directly the datetime value does nothing HOT 4
- Expanded prop not working on o-input HOT 2
- Feature(table) : Give access to filtered table length HOT 1
- TagInput: regressions with maxitems and tag removal
- Support custom constraint validation (setCustomValidity) HOT 1
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 oruga.