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

Fix tags select clear button #1463

Merged
merged 6 commits into from
Dec 5, 2024
Merged

Conversation

Oaphi
Copy link
Member

@Oaphi Oaphi commented Dec 3, 2024

closes #1462

This PR consists of a couple of fixes for tag handling:

  • save_draft method on the posts_controller now validates that the incoming tags array does not consist of empty elements only;
  • save_draft method removes existing tags array before inserting new elements (ensures correct partial updates);
  • reduced delay before a draft is saved to 1 second (3 seconds is way too long to be useful);
  • tag clear button requires placeholder to be set to work (select2 doesn't check if placeholder is provided before accessing its id property);
  • include_blank option should not be used with multiple select fields. Otherwise, select2 will add an ephemeral tag (with an empty name) every time it's cleared;

@Oaphi Oaphi self-assigned this Dec 3, 2024
@Oaphi Oaphi requested a review from a team December 3, 2024 15:29
@Oaphi Oaphi changed the title Fix clear Fix tags select clear button Dec 3, 2024
@Oaphi Oaphi marked this pull request as ready for review December 3, 2024 16:10
@cellio cellio merged commit 6b22ff8 into develop Dec 5, 2024
7 checks passed
@cellio cellio deleted the 0valt/1462/fix-tags-select-clear branch December 5, 2024 18:03
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

Successfully merging this pull request may close these issues.

Clear button on the tags field is broken
3 participants