-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Subject of the issue
Currently, the onItemFocus and onItemBlur methods exist only to control whether an item is highlighted.
adapt-contrib-mcq/js/McqView.js
Lines 32 to 43 in 4fffe4a
| onItemFocus(event) { | |
| if (!this.model.isInteractive()) return; | |
| const index = parseInt($(event.currentTarget).data('adapt-index')); | |
| const item = this.model.getChildren().findWhere({ _index: index }); | |
| item.set('_isHighlighted', true); | |
| } | |
| onItemBlur(event) { | |
| const index = $(event.currentTarget).data('adapt-index'); | |
| const item = this.model.getChildren().findWhere({ _index: index }); | |
| item.set('_isHighlighted', false); | |
| } |
The _isHighlighted property then determines if an is-highlighted class should be added to the item.
adapt-contrib-mcq/templates/mcq.jsx
Lines 79 to 85 in 4fffe4a
| className={classes([ | |
| 'mcq-item__label', | |
| 'u-no-select', | |
| !_isEnabled && 'is-disabled', | |
| _isHighlighted && 'is-highlighted', | |
| (_isCorrectAnswerShown ? _shouldBeSelected : _isActive) && 'is-selected' | |
| ])} |
There are no styles associated with a is-highlighted either in the plugin or in core. It's unclear whether this CSS class was ever used. For targeting focus states, there are CSS selectors that can be used that are supported by modern browsers.
Unless anyone objects, I think we should remove references to _isHighlighted altogether. This applies to GMCQ and possibly Matching as well.
Your environment
- MCQ 7.6.0
Metadata
Metadata
Assignees
Labels
Type
Projects
Status