Skip to content

Conversation

@alexandrevryghem
Copy link
Member

References

Description

Fixed an issue where onebox fields that use vocabularies don't trigger the onBlur event. This is problematic because error messages are not shown when the field is focused. Because the onBlur event is responsible for setting the hasFocus boolean to false and that onBlur was never triggered, the form control remained in the hasFocus state once you interacted with it until you refreshed the whole page. This caused the error message to always be hidden once you interacted with the field.

Instructions for Reviewers

List of changes in this PR:

  • When the input field loses focus and the vocabulary modal isn't open, the regular onBlur event is now triggered which causes the error message to be displayed
  • When the input field loses focus and the vocabulary modal is open, the onBlur event will not be triggered, otherwise the value won't be properly set

Guidance for how to test this PR: see #4501

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

… user interaction with the field

This was because the blur event was never triggered, so the field still thinks that the field is being focused
@alexandrevryghem alexandrevryghem added this to the 10.0 milestone Jun 23, 2025
@alexandrevryghem alexandrevryghem self-assigned this Jun 23, 2025
@alexandrevryghem alexandrevryghem added component: submission component: controlled vocabulary related to controlled vocabulary or value-pairs dropdowns port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release labels Jun 23, 2025
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Jun 23, 2025
@github-actions
Copy link

github-actions bot commented Jul 8, 2025

Hi @alexandrevryghem,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug component: controlled vocabulary related to controlled vocabulary or value-pairs dropdowns component: submission merge conflict port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

Error message from controlled vocabulary fields remains hidden after user interaction

1 participant