Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Block v3 placeholders sometimes missing

Aberta
#1,007 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
55/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
php
Domínio
frontend

Direção de pesquisa

Comece reproduzindo o caso de edição inline de block v3 com espaços em branco no ACF-attribute element; em seguida, examine a regra CSS e o comportamento do placeholder mostrado nas capturas de tela vinculadas. Considera-se concluído quando o placeholder permanece visível para um campo vazio, mesmo quando o template contém espaços em branco de formatação.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Describe the bug
When using inline editing in blocks v3, the placeholder can sometimes be missing. This is because the placeholder is shown via CSS when the target element is :empty, but whitespace in the code can prevent :empty from working.

To Reproduce
Steps to reproduce the behavior:

  1. In the render template, include whitespace in the element with the ACF attributes.
  2. The editor experience can be buggy as shown in the video below.
  3. Remove the whitespace in the template and the placeholder is more stable.

Expected behavior
The placeholder should be visible when the field is empty, not the element, because the element can have whitespace due to code formatting.

Screenshots or Video
CSS rule: https://screenshot.electricpulp.com/CKLzlHfq9h4CZkpXcyMF
Whitespace preventing the rule: https://screenshot.electricpulp.com/62ljqcQnnJ0ynCfND65l
Preheading without white space (stable), heading with white space (unstable): https://screenshot.electricpulp.com/fDbBddzyyL6LTC8kjcV5

Code
Tabbed/intended code causes instability:

<div class="hero__preheading" <?= acf_inline_text_editing_attrs('pre_heading', ['placeholder' => 'Add a pre heading (optional)']); ?>>
    <?= get_field('pre_heading') ?>
</div>

Whitespace removed works:

<div class="hero__preheading" <?= acf_inline_text_editing_attrs('pre_heading', ['placeholder' => 'Add a pre heading (optional)']); ?>><?= get_field('pre_heading') ?></div>

Version Information:

  • WordPress Version 6.9.4
  • PHP Version 8.2
  • ACF Pro 6.7.1
  • Chrome Version 146.0.7680.154

Additional context
Possible solution: rather than relying on :empty, check the field value for non-null and then toggle a class on the target element. The ::before used for the placeholder can then be shown with that class.

Linguagem predominante
PHP
Estrelas
946
Forks
197
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de AdvancedCustomFields/acf

Todas as issues de AdvancedCustomFields/acf

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.