Closed thejimu closed 7 months ago
I can't reproduce this bug in a fresh installation of silverstripe/installer
.
Here's my page - I'm not sure if it matches what you have, because your "how to reproduce" doesn't provide a full code sample:
<?php
namespace {
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\TagField\StringTagField;
class Page extends SiteTree
{
private static $db = [
'Attributes' => 'Varchar',
];
private static $has_one = [];
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName('Tags');
$fields->addFieldsToTab('Root.Main', [
StringTagField::create(
'AttributeSelect',
'Attributes',
['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'],
$this->Attributes
)
->setShouldLazyLoad(false)
->setCanCreate(false)
]);
return $fields;
}
}
}
after selecting an item the tagfield disappears
As you can see I have no problem adding or removing items in the StringTagField
:
Screencast from 08-03-24 10:10:29.webm
Can you please provide more reproduction steps? If you did not in fact reproduce this in a fresh installation of silverstripe/installer, can you please try that?
I can't reproduce this and there has been no further information about how to reproduce it - so I'm going to close this. If someone can provide more detailed reproduction steps I can reopen it and investigate further.
After upgrading one of our websites, we face the same issue using tag field 2.11.2 in Silverstripe 4. From my understanding this line causes the issue:
this.selectedComponentRef.select
is undefined, I suppose it should be this.selectComponentRef.wrapper
as this is defined and references the dom element.
Edit: Downgrading to 2.11.1 resolves this issue.
@sb-relaxt-at Thank you for that context - but I still don't have any reproduction steps that I can follow to actually see this bug for myself. Can you please provide me with reproduction steps?
I'll leave this issue closed until I have steps I can follow to reliably reproduce the bug.
Module version(s) affected
2.11.2
Description
On stringtagfield after selecting an item the tagfield disappears with the following error in console:
Uncaught TypeError: this.selectComponentRef.select is undefined
Also tried to install tagfield onto a fresh install but got the following composer error:
Edit: Disabled Lazy load, lazy loading produces no results. Edit 2: Enabling "canCreate" allows tagfield to work.
How to reproduce
Possible Solution
canCreate=true is all good.
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)