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

Customization #51

Open
shafi-shaikat opened this issue Apr 11, 2017 · 2 comments
Open

Customization #51

shafi-shaikat opened this issue Apr 11, 2017 · 2 comments

Comments

@shafi-shaikat
Copy link

Would love to have some customization feature like tagName.

@sheriffderek
Copy link

I just added a tagName property and it does add one... but the markup, in general, is still a bit confusing to me.

Idealy, I'd want something like this: https://codepen.io/sheriffderek/pen/4e05ec823df4b43210271089c1a14117/

<label for='file-input-1' class='input-w file'>
  <div class='label'>
    <span>Click here to upload a file buddy!</span>
  </div>

  <input id='file-input-1' class='input' type='file' />
</label>

This is the default markup:

<span id="ember682" class="x-file-input ember-view">
  <input type="file" id="gkz9g" tabindex="0" class="x-file--input">
  <label for="gkz9g">
    Upload
  </label>
</span>

This is how you can change it a bit:
{{x-file-input tagName='div' class='my-class'}}

<div id="ember682" class="my-class x-file-input ember-view">
  <input type="file" id="clpc3" tabindex="0" class="x-file--input">
  <label for="clpc3">
    Upload
  </label>
</div>

So, it has the same customization as most components do - I think.

You could also create a new component and .extend() this component and change things from the component's controller etc., right?

@cowboyd
Copy link
Collaborator

cowboyd commented Aug 10, 2017

You could definitely do that. If you want to customize, you can always drop it into

// app/components/x-file-input.js
import XFileInput from 'emberx-file-input/components/x-file-input';

export default XFileInput.extend({
  tagName: 'div'
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants