code: protected function wantToHandle(AbstractEnvironmentAwareEvent $event)
      {
          /** @var GetPropertyOptionsEvent $event */
          if (!parent::wantToHandle($event)) {
              return false;
          }
          if ($event->getPropertyName() !== 'type') {
              return false;
          }
  
          $request = $this->requestStack->getCurrentRequest();
          if ($request->request->get('act', null) === 'select' && !$event->getModel()->getId()) {
              return false;
          }
  
          return true;
      }
docs: Test if we want to handle the event.
  
  @param AbstractEnvironmentAwareEvent $event The event to evaluate.
  
  @return bool