@@ -3,7 +3,7 @@ import type { CommentEnhancer, CommentSpot } from './enhancer'
33import { GitHubEnhancer } from './enhancers/github'
44
55export interface EnhancedTextarea < T extends CommentSpot = CommentSpot > {
6- element : HTMLTextAreaElement
6+ textarea : HTMLTextAreaElement
77 spot : T
88 handler : CommentEnhancer < T >
99 overtype : OverType
@@ -36,7 +36,7 @@ export class EnhancerRegistry {
3636 const result = handler . tryToEnhance ( textarea )
3737 if ( result ) {
3838 const [ overtype , spot ] = result
39- return { element : textarea , handler, overtype, spot }
39+ return { handler, overtype, spot, textarea }
4040 }
4141 } catch ( error ) {
4242 console . warn ( 'Handler failed to identify textarea:' , error )
@@ -58,7 +58,7 @@ export class TextareaRegistry {
5858 private textareas = new Map < HTMLTextAreaElement , EnhancedTextarea < any > > ( )
5959
6060 register < T extends CommentSpot > ( textareaInfo : EnhancedTextarea < T > ) : void {
61- this . textareas . set ( textareaInfo . element , textareaInfo )
61+ this . textareas . set ( textareaInfo . textarea , textareaInfo )
6262 // TODO: register as a draft in progress with the global list
6363 }
6464
0 commit comments