Skip to content
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

Input 'field' attribute is missing #22

Closed
mutil opened this issue Dec 6, 2022 · 3 comments · Fixed by #24
Closed

Input 'field' attribute is missing #22

mutil opened this issue Dec 6, 2022 · 3 comments · Fixed by #24
Labels
enhancement New feature or request

Comments

@mutil
Copy link

mutil commented Dec 6, 2022

All other directus input fields have a field attribute. Can you please add it for consistency?
For my use case, this is needed for selecting the input and doing further manipulations in another interface.

@duydvu
Copy link
Contributor

duydvu commented Dec 6, 2022

Hi @mutil , I do not quite understand your problem. Could you make it clear?

@mutil
Copy link
Author

mutil commented Dec 6, 2022

Hi @duydvu,

In my custom slug extension I have this code: document.querySelector("input[field=name]").
This works with the default input interface but not with the computed one, because it’s missing field on the input element.

Generated html of default input:
<input loading="false" width="0" collection="artists" field="name" field-data="[object Object]" primary-key="10" autocomplete="off" type="text" step="1" data-v-54898a1e="">

Generated html of computed input:
<input loading="false" width="0" field-data="[object Object]" length="255" autocomplete="off" type="string" step="1" data-v-54898a1e="">

As a side note, I believe type="string" is not valid value for the type attribute and maybe collection and primary-key could be added also.

@duydvu
Copy link
Contributor

duydvu commented Dec 7, 2022

OK I understand. I will add it to the next version.

@duydvu duydvu added the enhancement New feature or request label Dec 20, 2022
duydvu added a commit that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants