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

Placeholder text only shows when the page first loads #911

Closed
zoaked opened this issue Sep 23, 2021 · 6 comments
Closed

Placeholder text only shows when the page first loads #911

zoaked opened this issue Sep 23, 2021 · 6 comments
Labels

Comments

@zoaked
Copy link

zoaked commented Sep 23, 2021

Description:
The placeholder text in select mode is disappearing after interacting with tagify

Analysis:
There is CSS applied to the input that sets the placeholder opacity to 1 using the :empty psudo selector. When that selector does not match the default styling sets the opacity to 0. When the page first loads the placeholder text is shown. Selecting a tag and then removing it hides the placeholder text because a <br> child is left behind. This tag is not shown as CSS has set it's display to none. Since it is there at all the parent element is technically not empty and so the override styles no longer apply.

This did not occur in 4.7.2 - it only started with 4.8.0 so something in one of these commits is adding that extra br tag.

Demo:
Previous version working
Latest version not working

@yairEO yairEO added the Bug label Sep 23, 2021
@yairEO
Copy link
Owner

yairEO commented Sep 23, 2021

I will fix it promptly (next few days)

@yairEO yairEO closed this as completed in 09ce6f1 Sep 24, 2021
@gugiserman
Copy link

gugiserman commented Sep 25, 2021

@yairEO I see you pushed a release related to this issue and closed it but I'm on v4.8.1 using mixed mode (textarea, vanilla) and still having a similar problem, just to let you know 😶

When I manually erase all text content (either by selecting all and hitting backspace or just hitting backspace character by character until empty), placeholder is not restored (stays empty forever) and I get this error in console:

tagify.min.js:8 Uncaught TypeError: Cannot read properties of null (reading 'nodeType')
    at b.onKeydown (tagify.min.js:8)

Update: I just tried v4.7.2 as mentioned in this issue original report and it works! So I think it's same to assume the bug is not fixed entirely. I won't have time today to check it out or make a demo project, sorry 😞

@yairEO
Copy link
Owner

yairEO commented Sep 25, 2021

You opened the issue for select-mode, so that commit closed that issue. Now there is another issue, with mix-mode.
That is another thing :) You should have been more accurate when detailing the bug, I only debugged this in select-mode and did not even bothered checking mix, since I thought you need this urgently for select

I will work on a fix for mix-mode

@gugiserman
Copy link

You opened the issue for select-mode, so that commit closed that issue. Now there is another issue, with mix-mode.
That is another thing :) You should have been more accurate when detailing the bug, I only debugged this in select-mode and did not even bothered checking mix, since I thought you need this urgently for select

I will work on a fix for mix-mode

I'm not the author of the issue 😆 Sorry, I should've opened a new issue, I didn't understand his issue was specifically for select mode.

Thanks for the quick reply and for the awesome library by the way! Absolutely life saver!

@zoaked
Copy link
Author

zoaked commented Sep 25, 2021

Thanks for jumping on this report! There seems to be a bit of confusion as I do not use mix mode so only observed the issue in select mode. Someone else jumped in afterwards to expand the issue report as happening in other modes. (mix) That is why it was not detailed in the original bug. Thank you again for all your efforts in maintaining this library.

@yairEO
Copy link
Owner

yairEO commented Sep 25, 2021

Thank you both for the nice words :)

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

No branches or pull requests

3 participants