[6.x]: LinkControl.vue always displays the “Label” field even when showLabelField is false

クローズ 初心者向け
#19,806 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
90/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
frontend

調査の方向性

resources/js/modules/forms/LinkControl.vue から始め、showLabelField が craft-link-field にどのように渡されているかを確認し、隣接する modelValue と advancedFields の bindings と比較します。showLabelField が false のときに Control Panel が Label 入力を非表示にし、true のときには引き続き表示することを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug repo:cms
What happened?
Description

When a Link field has showLabelField set to false (either via a custom Link field's settings or via a custom/native field layout element configuring a LinkControl), the "Label" input is still rendered in the Control Panel.

AI Says:

In resources/js/modules/forms/LinkControl.vue, the property is bound as an attribute rather than a DOM property:

<!-- Current -->
<craft-link-field
  :types="control.props.types"
  .modelValue="value"
  :name="editable ? inputName(control.path) : ''"
  :show-label-field="control.props.showLabelField"
  .advancedFields="control.props.advancedFields"
  :disabled="!editable"
  @apply="apply"
/>

Changing the binding from an attribute to a DOM property using the . prefix, consistent with .modelValue and .advancedFields appears to address this:

.showLabelField="control.props.showLabelField"
Craft CMS version

6.0.0-alpha.19

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions
主要言語
PHP
スター
3.6k
フォーク
712
平均マージ
13時間 8分
マージ済み PR(30日)
366

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

craftcms/cms のほかの issue

craftcms/cms の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。