File tree Expand file tree Collapse file tree
hwproj.front/src/components/Solutions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,12 +232,25 @@ const TaskSolutionComponent: FC<ISolutionProps> = (props) => {
232232 </ Grid > }
233233 { ! showThumbs && < Grid item >
234234 < Rating
235+ key = { solution ?. id }
235236 name = "customized"
236237 size = "large"
237238 defaultValue = { 2 }
238239 max = { maxRating }
239240 value = { points }
240241 readOnly = { ! isEditable }
242+ onMouseDown = { event => {
243+ const isFirefox = navigator . userAgent . toLowerCase ( ) . includes ( 'firefox' )
244+ if ( event . ctrlKey && isFirefox ) {
245+ const ratingElement = event . currentTarget
246+ const { left, width} = ratingElement . getBoundingClientRect ( )
247+ const relativeX = ( event . clientX - left ) / width
248+ const star = Math . ceil ( relativeX * maxRating ) || 0
249+ const rating = star === points ? 0 : star
250+
251+ clickForRate ( rating || 0 , true )
252+ }
253+ } }
241254 onChange = { ( _ , newValue ) => {
242255 clickForRate ( newValue || 0 , true )
243256 } }
You can’t perform that action at this time.
0 commit comments