feat: use getList

This commit is contained in:
karishmas6
2024-08-08 00:39:28 +05:30
parent 64b94d0db2
commit b13a92a24b

View File

@@ -111,7 +111,7 @@ export const BrowserWindow = () => {
clickY >= highlightRect.top && clickY >= highlightRect.top &&
clickY <= highlightRect.bottom clickY <= highlightRect.bottom
) { ) {
if (getText === true) { if (getText === true || getList === true) {
const options = getAttributeOptions(highlighterData.elementInfo?.tagName || ''); const options = getAttributeOptions(highlighterData.elementInfo?.tagName || '');
if (options.length > 1) { if (options.length > 1) {
setAttributeOptions(options); setAttributeOptions(options);
@@ -146,7 +146,7 @@ export const BrowserWindow = () => {
data = selectedElement.info?.innerText || ''; data = selectedElement.info?.innerText || '';
} }
{ {
if (getText === true) { if (getText === true || getList === true) {
addTextStep('', data, { addTextStep('', data, {
selector: selectedElement.selector, selector: selectedElement.selector,
tag: selectedElement.info?.tagName, tag: selectedElement.info?.tagName,
@@ -161,7 +161,7 @@ export const BrowserWindow = () => {
return ( return (
<div onClick={handleClick}> <div onClick={handleClick}>
{ {
getText === true ? ( getText === true || getList === true ? (
<GenericModal <GenericModal
isOpen={showAttributeModal} isOpen={showAttributeModal}
onClose={() => { }} onClose={() => { }}
@@ -179,7 +179,7 @@ export const BrowserWindow = () => {
</GenericModal> </GenericModal>
) : null ) : null
} }
{(getText === true && !showAttributeModal && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ? {((getText === true || getList === true) && !showAttributeModal && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?
<Highlighter <Highlighter
unmodifiedRect={highlighterData?.rect} unmodifiedRect={highlighterData?.rect}
displayedSelector={highlighterData?.selector} displayedSelector={highlighterData?.selector}