Skip to content

Commit

Permalink
feat(applet): allow select-text for string data fields (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong authored Jun 3, 2024
1 parent 7ee6ab3 commit b5e9587
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/applet/src/components/state/StateFieldViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ const normalizedDisplayedValue = computed(() => {
const _type = (props.data.value as InspectorCustomState)?._custom?.type
const _value = type.value === 'custom' && !_type ? `"${displayedValue.value}"` : (displayedValue.value === '' ? `""` : displayedValue.value)
const normalizedType = type.value === 'custom' && _type === 'ref' ? getInspectorStateValueType(_value) : type.value
const result = `<span class="${normalizedType}-state-type flex whitespace-nowrap">${_value}</span>`
const selectText = type.value === 'string' ? 'select-text' : ''
const result = `<span class="${normalizedType}-state-type flex whitespace-nowrap ${selectText}">${_value}</span>`
if (extraDisplayedValue)
return `${result} <span class="text-gray-500">(${extraDisplayedValue})</span>`
Expand Down

0 comments on commit b5e9587

Please sign in to comment.