onaluf / fate

Flexible Angular Text Editor
MIT License
37 stars 14 forks source link

fate-material placeholder doesn't seem to work #46

Closed ivanlucky22 closed 5 years ago

ivanlucky22 commented 6 years ago

Hi, I've tried your fate-material and the placeholder doesn't seem to work there. I've used it like that:

 <fate-material  [(ngModel)]="storyItem.data"
                           [placeholder]="'hello'" ></fate-material>

storyItem.data equals to '' (Empty string) on rendering.

After editor rendered it appears to be empty. Am I doing something wrong?

onaluf commented 6 years ago

I can't seem to reproduce this effect, which platform/browser do you see this occurring on? Would you be able to produce a reduced test case?

pichukov commented 6 years ago

Hey, I have the same issue. I use Mac OS and the placeholder doesn't work in Safari and Chrome as well.

onaluf commented 6 years ago

@ivanlucky22 and @pichukov, do you experience this issue when visiting the project website (and clearing the content of the editors)? Or is it something that appears only when you use the editor in your own project?

If it’s on your own project maybe you cloud send me your package.json, cloud help to figure out if it’s an issue with the version of angular...

sandiphob commented 6 years ago

when I took a look at the fate-material selector template within the package, placeholder was not being set. Whereas for the the bootstrap template it was set. When I added [placeholder]=\"placeholder\", it worked

            selector: 'fate-material',
            template: `<fate-input customClass="" [uiId]="uiId" [row]="row" [ngModel]="passthrough" (ngModelChange)="onChange($event)"></fate-input>
onaluf commented 5 years ago

That's very strange @sandiphob, I normally material should take care of the placeholder, you shouldn't need to use the "native" one provided to the input element. Which version of material are you using?

I'll add the placeholder passthrough and make sure that it doesn't causes any other issues.

sandiphob commented 5 years ago

Hi @onaluf , I am using Material 7.0.1

onaluf commented 5 years ago

Ok so I tried to use the placeholder attribute but it creates glitches when both itself and the "floating" version of material are both used.

I guess it may have to do with how MAT_LABEL_GLOBAL_OPTIONS is configured. I'll try to make both play nice together, maybe add the option to either user labels or placeholder there.

onaluf commented 5 years ago

I wonder about something @sandiphob, @pichukov and @ivanlucky22: do you wrap fate-material in a mat-form-field like so:

<mat-form-field>
   <fate-material placeholder="Some text"></fate-material>
</mat-form-field>

If not could you try to see if it solves your problem ?

onaluf commented 5 years ago

:tada: This issue has been resolved in version 1.8.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sandiphob commented 5 years ago

Thank you @onaluf I can confirm that placeholder works when wrapping mat-form-field around fate-material.