framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

Input value overlaps floating label (MD)

Open anpegar opened this issue 8 years ago • 7 comments

Hi everybody,

I'm developing a project with framework7 and MD theme but when I set a value to a text field from javascript, the value overlaps the label.

I've tried with framerwork7 2.0.5 but it also happens with the other versions. To fix it I used jquery but you can also use native javascript.

I have solved it in this way but, is there any more elegant way to do it? https://codepen.io/anon/pen/xpYEKV

Thanks in advance.

The error: errorpen

My solution: solution

anpegar avatar Jan 09 '18 11:01 anpegar

How the F7 will know that you have set value there? You must then trigger "change" event on modified input

nolimits4web avatar Jan 09 '18 11:01 nolimits4web

Hi @nolimits4web,

Do you have an example about that? Sorry, but I don't know hoe to do it.

Thanks again.

anpegar avatar Jan 09 '18 11:01 anpegar

In v2 there is app.input.checkEmptyState method http://framework7.io/docs/inputs.html#input-app-methods

Otherwise call $('your-input-selector').trigger('change')

nolimits4web avatar Jan 09 '18 11:01 nolimits4web

ok, perfect !!

In v2 app.input.checkEmptyState('#myname'); works fine, now I'll try in v1.6.4 with $('myname').trigger('change') because in v2 this it doesn't work.

Why in v1.6.4? Because I'm using framework7-vue and I think at the moment it doesn't work with v2, isn't?

thanks.

anpegar avatar Jan 09 '18 11:01 anpegar

Hi again,

In v1.6.4 it doesn't work, could you check out my codepen please?

https://codepen.io/anon/pen/xpYEKV

thanks.

anpegar avatar Jan 09 '18 12:01 anpegar

Some issue with jQuery, use Dom7 instead https://codepen.io/anon/pen/wpydJa

nolimits4web avatar Jan 09 '18 13:01 nolimits4web

Works fine !! Thanks so much for your help.

anpegar avatar Jan 10 '18 07:01 anpegar